go-cook-portal/views/layout/util.go

16 lines
236 B
Go

package layout
import (
"context"
"templ-test/domain"
)
func useLightOrDarkTheme(ctx context.Context) string {
cookie := ctx.Value(domain.CookieSettingsDarkMode)
if cookie == "on" {
return "dark"
} else {
return "light"
}
}