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"
|
2025-03-29 12:51:42 +00:00
|
|
|
class="theme-toggle hx:cursor-pointer 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 hx:dark:text-gray-400 hx:hover:bg-gray-100 hx:hover:text-gray-900 hx:dark:hover:bg-primary-100/5 hx:dark:hover: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
|
|
|
>
|
2025-03-29 12:51:42 +00:00
|
|
|
<div class="hx:flex hx:items-center hx:gap-2 hx:capitalize">
|
|
|
|
{{- partial "utils/icon.html" (dict "name" "sun" "attributes" "height=12 class=\"hx:group-data-[theme=light]:hidden\"") -}}
|
|
|
|
{{- if not $hideLabel }}<span class="hx:group-data-[theme=light]:hidden">{{ $light }}</span>{{ end -}}
|
|
|
|
{{- partial "utils/icon.html" (dict "name" "moon" "attributes" "height=12 class=\"hx:group-data-[theme=dark]:hidden\"") -}}
|
|
|
|
{{- if not $hideLabel }}<span class="hx:group-data-[theme=dark]:hidden">{{ $dark }}</span>{{ end -}}
|
2023-08-07 23:48:07 +01:00
|
|
|
</div>
|
|
|
|
</button>
|