2024-04-13 11:50:05 -07:00
|
|
|
package layout
|
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
2024-04-14 18:38:09 -07:00
|
|
|
"templ-test/domain"
|
2024-04-13 11:50:05 -07:00
|
|
|
)
|
|
|
|
|
|
|
|
func useLightOrDarkTheme(ctx context.Context) string {
|
2024-04-14 18:38:09 -07:00
|
|
|
cookie := ctx.Value(domain.CookieSettingsDarkMode)
|
|
|
|
if cookie == "on" {
|
|
|
|
return "dark"
|
|
|
|
} else {
|
|
|
|
return "light"
|
|
|
|
}
|
2024-04-13 11:50:05 -07:00
|
|
|
}
|