diff --git a/layouts/partials/theme-toggle.html b/layouts/partials/theme-toggle.html new file mode 100644 index 0000000..cb09b14 --- /dev/null +++ b/layouts/partials/theme-toggle.html @@ -0,0 +1,21 @@ +{{- $hideLabel := .hideLabel | default false -}} + +{{- $changeTheme := (T "changeTheme") | default "Change theme" -}} +{{- $light := (T "light") | default "Light" -}} +{{- $dark := (T "dark") | default "Dark" -}} + + + + + {{- partial "utils/icon.html" (dict "name" "sun" "attributes" "height=20 class=\"hx:group-data-[theme=light]:hidden\"") -}} + {{- if not $hideLabel }}{{ $light }}{{ end -}} + {{- partial "utils/icon.html" (dict "name" "moon" "attributes" "height=20 class=\"hx:group-data-[theme=dark]:hidden\"") -}} + {{- if not $hideLabel }}{{ $dark }}{{ end -}} + + \ No newline at end of file