mirror of
https://github.com/imfing/hextra.git
synced 2025-05-13 02:46:28 -04:00
Fix icon size in navbar theme toggle.
- Add navbar boolean to theme-toggle partial arguments. - Add logic in theme-toggle to set icon size based on navbar boolean.
This commit is contained in:
parent
ebdaf0fd4a
commit
5c0698c3c0
@ -32,7 +32,7 @@
|
||||
{{- if eq .Params.type "search" -}}
|
||||
{{- partial "search.html" (dict "params" .Params) -}}
|
||||
{{- else if eq .Params.type "theme-toggle" -}}
|
||||
{{- partial "theme-toggle.html" (dict "hideLabel" (.Params.hideLabel | default true)) -}}
|
||||
{{- partial "theme-toggle.html" (dict "navbar" true "hideLabel" (.Params.hideLabel | default true)) -}}
|
||||
{{- else -}}
|
||||
{{- $link := .URL -}}
|
||||
{{- $external := strings.HasPrefix $link "http" -}}
|
||||
|
@ -1,3 +1,6 @@
|
||||
{{- $navbar := .navbar | default false -}}
|
||||
{{- $height := 12 -}}
|
||||
{{- if $navbar -}}{{- $height = 24 -}}{{- end -}}
|
||||
{{- $hideLabel := .hideLabel | default false -}}
|
||||
|
||||
{{- $changeTheme := (T "changeTheme") | default "Change theme" -}}
|
||||
@ -13,9 +16,9 @@
|
||||
aria-label="{{ $changeTheme }}"
|
||||
>
|
||||
<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\"") -}}
|
||||
{{- partial "utils/icon.html" (dict "name" "sun" "attributes" (printf "height=%d class=\"group-data-[theme=light]:hx-hidden\"" $height)) -}}
|
||||
{{- 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\"") -}}
|
||||
{{- partial "utils/icon.html" (dict "name" "moon" "attributes" (printf "height=%d class=\"group-data-[theme=dark]:hx-hidden\"" $height)) -}}
|
||||
{{- if not $hideLabel }}<span class="group-data-[theme=dark]:hx-hidden">{{ $dark }}</span>{{ end -}}
|
||||
</div>
|
||||
</button>
|
||||
|
Loading…
x
Reference in New Issue
Block a user