From 01ece71945efd5159b91aa3d8ebe741d707e5269 Mon Sep 17 00:00:00 2001 From: chuan Date: Sat, 16 May 2026 19:21:13 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0=E4=B8=BB=E9=A2=98?= =?UTF-8?q?=E5=88=87=E6=8D=A2=E6=8C=89=E9=92=AE=E5=B9=B6=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=E5=AF=BC=E8=88=AA=E6=A0=8F=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- styles/components/navbar.ts | 23 +++++++++++++++++++++-- templates/base/head_navbar.tmpl | 24 ++++++++++++++++++++++-- templates/base/theme_toggle.tmpl | 15 +++++++++++++++ 3 files changed, 58 insertions(+), 4 deletions(-) create mode 100644 templates/base/theme_toggle.tmpl diff --git a/styles/components/navbar.ts b/styles/components/navbar.ts index e2571da..a220d70 100644 --- a/styles/components/navbar.ts +++ b/styles/components/navbar.ts @@ -10,6 +10,25 @@ export const navbarRight = ` .navbar-right { min-height: 48px; } + .navbar-right { + gap: 8px; + > .navbar-theme-toggle { + align-items: center; + justify-content: center; + border: 1px solid var(--color-light-border); + border-radius: var(--border-radius); + color: var(--color-text); + height: 32px; + min-height: 32px; + min-width: 32px; + padding: 0; + width: 32px; + &:hover, + &.active { + background-color: var(--color-nav-hoverBg); + } + } + } .navbar-left { gap: 8px; > .item { @@ -35,7 +54,7 @@ export const navbarRight = ` .navbar-right:has(.user-menu) { gap: 8px; /* 右侧按钮, 但不包括头像 */ - > .item:not(:last-child) { + > .item:not(.navbar-user-menu):not(.navbar-theme-toggle) { align-items: center; justify-content: center; gap: 4px; @@ -75,7 +94,7 @@ export const navbarRight = ` } .item.ui.dropdown { /* 头像菜单 */ - &:last-child { + &.navbar-user-menu { padding: 0; .text { /* 不显示头像右侧的小箭头下拉菜单标识 */ diff --git a/templates/base/head_navbar.tmpl b/templates/base/head_navbar.tmpl index 038de37..d18c0f2 100644 --- a/templates/base/head_navbar.tmpl +++ b/templates/base/head_navbar.tmpl @@ -29,7 +29,8 @@