summaryrefslogtreecommitdiffhomepage
path: root/templates
diff options
context:
space:
mode:
authorThomas Voss <mail@thomasvoss.com> 2024-08-07 16:59:51 +0200
committerThomas Voss <mail@thomasvoss.com> 2024-08-07 16:59:51 +0200
commiteca001e57f444372589d35196dab29ab22f09afb (patch)
treed2197dae4dc34a75da595a4411115ea0889293b8 /templates
parent6332cce84ceabf90d8c42167148f41d98d0c28b9 (diff)
Set a theme cookie
Diffstat (limited to 'templates')
-rw-r--r--templates/navbar.templ3
-rw-r--r--templates/root.templ2
2 files changed, 2 insertions, 3 deletions
diff --git a/templates/navbar.templ b/templates/navbar.templ
index 5007183..f0d654c 100644
--- a/templates/navbar.templ
+++ b/templates/navbar.templ
@@ -77,8 +77,7 @@ templ navbar() {
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
- <!-- TODO: if theme == dark -->
- if true {
+ if ctx.Value("theme").(string) == "dark" {
<path
d="M 7.28451 10.3333
C 7.10026 10.8546
diff --git a/templates/root.templ b/templates/root.templ
index da63caa..832846e 100644
--- a/templates/root.templ
+++ b/templates/root.templ
@@ -10,7 +10,7 @@ templ Root(head, body templ.Component) {
{{ p := ctx.Value("printer").(i18n.Printer) }}
<!DOCTYPE html>
- <html lang={ p.Locale.Code } data-theme="dark">
+ <html lang={ p.Locale.Code } data-theme={ ctx.Value("theme").(string) }>
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />