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 19:38:15 -07:00
|
|
|
value := ctx.Value(domain.CookieSettingsDarkMode)
|
|
|
|
if value == "on" {
|
2024-04-14 18:38:09 -07:00
|
|
|
return "dark"
|
|
|
|
} else {
|
|
|
|
return "light"
|
|
|
|
}
|
2024-04-13 11:50:05 -07:00
|
|
|
}
|