fix: 优化主题定制器按钮样式和布局,提升用户体验

This commit is contained in:
jxxghp
2026-06-02 17:02:23 +08:00
parent 880a34f508
commit 889a5c9e51
+30 -17
View File
@@ -95,12 +95,16 @@ function handleLayoutChange(layout: ThemeCustomizerLayout) {
</div> </div>
<div class="theme-customizer-header-actions"> <div class="theme-customizer-header-actions">
<VBadge color="error" dot :model-value="isCustomized" location="top end" offset-x="2" offset-y="2"> <VBadge color="error" dot :model-value="isCustomized" location="top end" offset-x="2" offset-y="2">
<IconBtn :aria-label="t('theme.customizer.reset')" @click="resetSettings"> <IconBtn
<VIcon icon="mdi-refresh" /> class="theme-customizer-header-icon-btn"
:aria-label="t('theme.customizer.reset')"
@click="resetSettings"
>
<VIcon class="theme-customizer-header-icon" icon="mdi-refresh" />
</IconBtn> </IconBtn>
</VBadge> </VBadge>
<IconBtn :aria-label="t('common.close')" @click="drawer = false"> <IconBtn class="theme-customizer-header-icon-btn" :aria-label="t('common.close')" @click="drawer = false">
<VIcon icon="mdi-close" /> <VIcon class="theme-customizer-header-icon" icon="mdi-close" />
</IconBtn> </IconBtn>
</div> </div>
</div> </div>
@@ -113,7 +117,7 @@ function handleLayoutChange(layout: ThemeCustomizerLayout) {
<h3 class="theme-customizer-section-title">{{ t('theme.customizer.primaryColor') }}</h3> <h3 class="theme-customizer-section-title">{{ t('theme.customizer.primaryColor') }}</h3>
<div class="theme-customizer-color-grid"> <div class="theme-customizer-color-grid">
<button <div
v-for="color in themeCustomizerPrimaryColors" v-for="color in themeCustomizerPrimaryColors"
:key="color.value" :key="color.value"
type="button" type="button"
@@ -123,9 +127,9 @@ function handleLayoutChange(layout: ThemeCustomizerLayout) {
@click="setPrimaryColor(color.value)" @click="setPrimaryColor(color.value)"
> >
<span class="theme-customizer-color-swatch" :style="{ backgroundColor: color.value }" /> <span class="theme-customizer-color-swatch" :style="{ backgroundColor: color.value }" />
</button> </div>
<button <div
type="button" type="button"
class="theme-customizer-color-option theme-customizer-color-option--picker" class="theme-customizer-color-option theme-customizer-color-option--picker"
:class="{ :class="{
@@ -134,7 +138,7 @@ function handleLayoutChange(layout: ThemeCustomizerLayout) {
:aria-label="t('theme.customizer.chooseCustomColor')" :aria-label="t('theme.customizer.chooseCustomColor')"
@click="openColorPicker" @click="openColorPicker"
> >
<VIcon icon="mdi-palette-outline" size="30" /> <VIcon class="theme-customizer-native-icon" icon="mdi-palette-outline" size="30" />
<input <input
ref="customColorInput" ref="customColorInput"
class="theme-customizer-native-color" class="theme-customizer-native-color"
@@ -142,12 +146,12 @@ function handleLayoutChange(layout: ThemeCustomizerLayout) {
:value="settings.primaryColor" :value="settings.primaryColor"
@input="handleCustomColorInput" @input="handleCustomColorInput"
/> />
</button> </div>
</div> </div>
<h3 class="theme-customizer-section-title">{{ t('common.theme') }}</h3> <h3 class="theme-customizer-section-title">{{ t('common.theme') }}</h3>
<div class="theme-customizer-option-grid theme-customizer-option-grid--theme"> <div class="theme-customizer-option-grid theme-customizer-option-grid--theme">
<button <div
v-for="theme in themeOptions" v-for="theme in themeOptions"
:key="theme.value" :key="theme.value"
type="button" type="button"
@@ -155,14 +159,14 @@ function handleLayoutChange(layout: ThemeCustomizerLayout) {
:class="{ 'is-active': settings.theme === theme.value }" :class="{ 'is-active': settings.theme === theme.value }"
@click="setTheme(theme.value)" @click="setTheme(theme.value)"
> >
<VIcon :icon="theme.icon" size="36" /> <VIcon class="theme-customizer-theme-icon" :icon="theme.icon" size="36" />
<span>{{ theme.title }}</span> <span>{{ theme.title }}</span>
</button> </div>
</div> </div>
<h3 class="theme-customizer-section-title">{{ t('theme.customizer.skins') }}</h3> <h3 class="theme-customizer-section-title">{{ t('theme.customizer.skins') }}</h3>
<div class="theme-customizer-preview-grid theme-customizer-preview-grid--skins"> <div class="theme-customizer-preview-grid theme-customizer-preview-grid--skins">
<button <div
v-for="skin in skinOptions" v-for="skin in skinOptions"
:key="skin.value" :key="skin.value"
type="button" type="button"
@@ -184,7 +188,7 @@ function handleLayoutChange(layout: ThemeCustomizerLayout) {
</span> </span>
</span> </span>
<span>{{ skin.title }}</span> <span>{{ skin.title }}</span>
</button> </div>
</div> </div>
<div v-if="showSemiDarkMenuOption" class="theme-customizer-semi-dark"> <div v-if="showSemiDarkMenuOption" class="theme-customizer-semi-dark">
@@ -206,7 +210,7 @@ function handleLayoutChange(layout: ThemeCustomizerLayout) {
<h3 class="theme-customizer-section-title"></h3> <h3 class="theme-customizer-section-title"></h3>
<div class="theme-customizer-preview-grid"> <div class="theme-customizer-preview-grid">
<button <div
v-for="layout in layoutOptions" v-for="layout in layoutOptions"
:key="layout.value" :key="layout.value"
type="button" type="button"
@@ -227,7 +231,7 @@ function handleLayoutChange(layout: ThemeCustomizerLayout) {
</span> </span>
</span> </span>
<span>{{ layout.title }}</span> <span>{{ layout.title }}</span>
</button> </div>
</div> </div>
</section> </section>
</PerfectScrollbar> </PerfectScrollbar>
@@ -252,7 +256,14 @@ function handleLayoutChange(layout: ThemeCustomizerLayout) {
html[data-theme='transparent'] .theme-customizer-drawer { html[data-theme='transparent'] .theme-customizer-drawer {
backdrop-filter: blur(var(--transparent-blur-heavy, 16px)); backdrop-filter: blur(var(--transparent-blur-heavy, 16px));
background-color: rgba(var(--v-theme-surface), var(--transparent-opacity-heavy, 0.5)) !important; background-color: rgba(var(--v-theme-surface), var(--transparent-opacity-heavy, 0.5)) !important;
box-shadow: -2px 0 6px rgba(0, 0, 0, 16%) !important; }
:is(html[data-theme='transparent'], .v-theme--transparent) .theme-customizer-card-option .theme-customizer-theme-icon,
:is(html[data-theme='transparent'], .v-theme--transparent) .theme-customizer-color-option .theme-customizer-native-icon,
:is(html[data-theme='transparent'], .v-theme--transparent) .theme-customizer-header-icon {
backdrop-filter: none !important;
background: transparent !important;
box-shadow: none !important;
} }
.theme-customizer-header { .theme-customizer-header {
@@ -337,6 +348,7 @@ html[data-theme='transparent'] .theme-customizer-drawer {
justify-content: center; justify-content: center;
border: 1px solid rgba(var(--v-theme-on-surface), 0.12); border: 1px solid rgba(var(--v-theme-on-surface), 0.12);
border-radius: 10px; border-radius: 10px;
appearance: none;
aspect-ratio: 1; aspect-ratio: 1;
color: rgba(var(--v-theme-on-surface), var(--v-high-emphasis-opacity)); color: rgba(var(--v-theme-on-surface), var(--v-high-emphasis-opacity));
cursor: pointer; cursor: pointer;
@@ -390,6 +402,7 @@ html[data-theme='transparent'] .theme-customizer-drawer {
align-items: center; align-items: center;
border: 1px solid rgba(var(--v-theme-on-surface), 0.12); border: 1px solid rgba(var(--v-theme-on-surface), 0.12);
border-radius: 10px; border-radius: 10px;
appearance: none;
color: rgba(var(--v-theme-on-surface), var(--v-high-emphasis-opacity)); color: rgba(var(--v-theme-on-surface), var(--v-high-emphasis-opacity));
cursor: pointer; cursor: pointer;
font-size: 1rem; font-size: 1rem;