Commit 1c25771aa1

1c25771aa12c79fb6774d8e899be7425a1681269

parent: d9bd3e965b

Unsigned

Duck <57977673+woducku@users.noreply.github.com> · 2026-06-22 04:26 UTC

Update AccentColor.vue

Layout: unified · split

docs/.vitepress/theme/components/settings/AccentColor.vue +64 −18
@@ -5,12 +5,36 @@ import { AccentColorStorageKey } from '../../constants'
55import MenuTitle from './MenuTitle.vue'
66
77const accentOptions = [
8 { key: 'ayanami', label: 'Ayanami', color: 'oklch(0.626 0.098 247.46)' },
9 { key: 'asuka', label: 'Asuka', color: '#F35640' },
10 { key: 'raora', label: 'Raora', color: '#F44088' },
11 { key: 'rebecca', label: 'Rebecca', color: '#18CF7A' },
12 { key: 'okayu', label: 'Okayu', color: '#BC87C5' },
13 { key: 'inanis', label: "Ina'nis", color: '#8F81B0' },
8 {
9 key: 'ayanami',
10 label: 'Ayanami',
11 shades: ['oklch(0.722 0.105 247.48)', 'oklch(0.626 0.098 247.46)', 'oklch(0.523 0.081 246.86)', 'oklch(0.43 0.066 246.75)', 'oklch(0.335 0.052 246.76)'],
12 },
13 {
14 key: 'asuka',
15 label: 'Asuka',
16 shades: ['#FB7F6E', '#F35640', '#E2432D', '#BD2C18', '#9C2818'],
17 },
18 {
19 key: 'raora',
20 label: 'Raora',
21 shades: ['#FB6BA9', '#F44088', '#D91A5D', '#C6104B', '#A4103E'],
22 },
23 {
24 key: 'rebecca',
25 label: 'Rebecca',
26 shades: ['#41E799', '#18CF7A', '#0DAC62', '#0E874F', '#116A42'],
27 },
28 {
29 key: 'okayu',
30 label: 'Okayu',
31 shades: ['#CDA4D5', '#BC87C5', '#A86BB2', '#915799', '#794A7F'],
32 },
33 {
34 key: 'inanis',
35 label: "Ina'nis",
36 shades: ['#A39AC0', '#8F81B0', '#816FA1', '#776392', '#645479'],
37 },
1438] as const
1539
1640const accentColor = useStorage(AccentColorStorageKey, 'ayanami')
@@ -23,34 +47,41 @@ const accentColor = useStorage(AccentColorStorageKey, 'ayanami')
2347 <span i-lucide:palette mr-1 aria-hidden="true" />
2448 </template>
2549 </MenuTitle>
26 <div class="accent-grid">
50 <div class="accent-list">
2751 <button
2852 v-for="option in accentOptions"
2953 :key="option.key"
3054 class="accent-btn"
55 :class="{ 'accent-btn--selected': accentColor === option.key }"
3156 :aria-pressed="accentColor === option.key"
3257 :aria-label="option.label"
3358 @click="accentColor = option.key"
3459 >
35 <span class="accent-swatch" :style="{ backgroundColor: option.color }" />
3660 <span class="accent-label">{{ option.label }}</span>
37 <span v-if="accentColor === option.key" i-lucide:check text-xs ml-auto />
61 <span class="accent-shades">
62 <span
63 v-for="(shade, i) in option.shades"
64 :key="i"
65 class="accent-shade"
66 :style="{ backgroundColor: shade }"
67 />
68 </span>
3869 </button>
3970 </div>
4071 </div>
4172</template>
4273
4374<style scoped>
44.accent-grid {
45 display: grid;
46 grid-template-columns: 1fr 1fr;
75.accent-list {
76 display: flex;
77 flex-direction: column;
4778 gap: 2px;
4879}
4980
5081.accent-btn {
5182 display: flex;
5283 align-items: center;
53 gap: 6px;
84 gap: 8px;
5485 padding: 5px 8px;
5586 border-radius: 8px;
5687 border: none;
@@ -66,15 +97,30 @@ const accentColor = useStorage(AccentColorStorageKey, 'ayanami')
6697 background-color: var(--vp-c-bg-soft);
6798}
6899
69.accent-swatch {
70 width: 16px;
71 height: 16px;
72 border-radius: 50%;
73 flex-shrink: 0;
100.accent-btn--selected {
101 background-color: var(--vp-c-brand-soft);
102}
103
104.accent-btn--selected:hover {
105 background-color: var(--vp-c-brand-soft);
74106}
75107
76108.accent-label {
77109 flex: 1;
78110 text-align: left;
79111}
112
113.accent-shades {
114 display: flex;
115 height: 1em;
116 border-radius: 4px;
117 overflow: hidden;
118 flex-shrink: 0;
119}
120
121.accent-shade {
122 width: 18px;
123 height: 100%;
124}
125
80126</style>