2023-08-13 22:18:20 +01:00
|
|
|
{{- $hideLabel := .hideLabel | default false -}}
|
|
|
|
|
2023-08-27 17:32:44 +01:00
|
|
|
{{- $changeTheme := (T "changeTheme") | default "Change theme" -}}
|
2023-10-26 04:02:47 -04:00
|
|
|
{{- $light := (T "light") | default "Light" -}}
|
|
|
|
{{- $dark := (T "dark") | default "Dark" -}}
|
2023-08-13 22:18:20 +01:00
|
|
|
|
2023-08-27 17:32:44 +01:00
|
|
|
|
|
|
|
<button
|
|
|
|
title="{{ $changeTheme }}"
|
|
|
|
data-theme="light"
|
2024-02-20 17:59:31 -05:00
|
|
|
class="theme-toggle hx-group hx-h-7 hx-rounded-md hx-px-2 hx-text-left hx-text-xs hx-font-medium hx-text-gray-600 hx-transition-colors dark:hx-text-gray-400 hover:hx-bg-gray-100 hover:hx-text-gray-900 dark:hover:hx-bg-primary-100/5 dark:hover:hx-text-gray-50"
|
2023-08-27 17:32:44 +01:00
|
|
|
type="button"
|
2023-10-26 04:02:47 -04:00
|
|
|
aria-label="{{ $changeTheme }}"
|
2023-08-27 17:32:44 +01:00
|
|
|
>
|
2024-02-20 17:59:31 -05:00
|
|
|
<div class="hx-flex hx-items-center hx-gap-2 hx-capitalize">
|
|
|
|
{{- partial "utils/icon.html" (dict "name" "sun" "attributes" "height=12 class=\"group-data-[theme=light]:hx-hidden\"") -}}
|
|
|
|
{{- if not $hideLabel }}<span class="group-data-[theme=light]:hx-hidden">{{ $light }}</span>{{ end -}}
|
|
|
|
{{- partial "utils/icon.html" (dict "name" "moon" "attributes" "height=12 class=\"group-data-[theme=dark]:hx-hidden\"") -}}
|
|
|
|
{{- if not $hideLabel }}<span class="group-data-[theme=dark]:hx-hidden">{{ $dark }}</span>{{ end -}}
|
2023-08-07 23:48:07 +01:00
|
|
|
</div>
|
|
|
|
</button>
|