diff options
| author | eltrac <hi@eltr.ac> | 2026-02-10 15:48:13 +0800 |
|---|---|---|
| committer | eltrac <hi@eltr.ac> | 2026-02-10 15:48:13 +0800 |
| commit | 044bc2ed2b2d48b8d7a2f4c53e49eba2da8ada1a (patch) | |
| tree | ca985210bd988e1595faba1a9f0898d03df0ece1 | |
| parent | 52758459a220fde27f1519d3fd3e99f3f2a52f80 (diff) | |
feat: theme switch style
| -rw-r--r-- | i18n/zh.yml | 4 | ||||
| -rw-r--r-- | layouts/_partials/header/other-navigation.html | 7 |
2 files changed, 8 insertions, 3 deletions
diff --git a/i18n/zh.yml b/i18n/zh.yml index fa2b539a..ea2c2906 100644 --- a/i18n/zh.yml +++ b/i18n/zh.yml @@ -1,5 +1,9 @@ lang: zh-CN seeArchive: 查看全部页面 +theme: + auto: 自动 + light: 亮色 + dark: 暗色 archivePage: postCountMonthly: '{{ . }} 篇文章' postCountAnnual: '共计 {{ . }} 篇文章' diff --git a/layouts/_partials/header/other-navigation.html b/layouts/_partials/header/other-navigation.html index ab6035f1..718b491c 100644 --- a/layouts/_partials/header/other-navigation.html +++ b/layouts/_partials/header/other-navigation.html @@ -2,10 +2,11 @@ <div class="flex gap-2 pr-2"> <!-- theme switch --> - <select onchange="switchTheme(this.value, true)" id="theme-select"> + <select onchange="switchTheme(this.value, true)" id="theme-select" + class="bg-neutral/10 border-1 border-[var(--text-color)] border-solid rd text-[var(--text-color)] font-serif text-size-[0.5rem] font-extrabold"> {{ $switches := slice "auto" "light" "dark" }} {{ range $switches }} - <option>{{ . }}</option> + <option value="{{ . }}">{{ T (printf "theme.%s" .) }}</option> {{ end }} </select> <!-- language switch --> @@ -16,7 +17,7 @@ {{- $entry := index $switch $lang -}} <a href="{{ $entry.url }}" - class="rounded-full text-center hover:no-underline {{ $langButtonSize }} + class="rd-full text-center hover:no-underline {{ $langButtonSize }} bg-neutral/10 border-1 border-[var(--text-color)] border-solid bg-[var(--block-background-color)] flex items-center justify-center" |
