Commit 1ab03abafe

1ab03abafe3c8ae9362a3a630c00f70f0b7f47b2

parent: 5279201008

Unsigned

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

Kurokami Fubuki

Layout: unified · split

docs/.vitepress/theme/Layout.vue +22 −7
@@ -572,7 +572,10 @@ watchEffect(() => {
572 ) 572 )
573}) 573})
574 574
575const accentPalettes: Record<string, Record<string, string>> = { 575type ShadeMap = Record<string, string>
576type PaletteEntry = ShadeMap | { dark: ShadeMap; light: ShadeMap }
577
578const accentPalettes: Record<string, PaletteEntry> = {
576 ayanami: { 579 ayanami: {
577 400: 'oklch(0.722 0.105 247.48)', 580 400: 'oklch(0.722 0.105 247.48)',
578 500: 'oklch(0.626 0.098 247.46)', 581 500: 'oklch(0.626 0.098 247.46)',
@@ -616,11 +619,20 @@ const accentPalettes: Record<string, Record<string, string>> = {
616 800: 'oklch(0.461 0.176 28.95)', 619 800: 'oklch(0.461 0.176 28.95)',
617 }, 620 },
618 fubuki: { 621 fubuki: {
619 400: 'oklch(0.82 0 0)', 622 dark: {
620 500: 'oklch(0.72 0 0)', 623 400: 'oklch(0.82 0 0)',
621 600: 'oklch(0.62 0 0)', 624 500: 'oklch(0.72 0 0)',
622 700: 'oklch(0.52 0 0)', 625 600: 'oklch(0.62 0 0)',
623 800: 'oklch(0.42 0 0)', 626 700: 'oklch(0.52 0 0)',
627 800: 'oklch(0.42 0 0)',
628 },
629 light: {
630 400: 'oklch(0.58 0 0)',
631 500: 'oklch(0.48 0 0)',
632 600: 'oklch(0.38 0 0)',
633 700: 'oklch(0.28 0 0)',
634 800: 'oklch(0.18 0 0)',
635 },
624 }, 636 },
625} 637}
626 638
@@ -628,7 +640,10 @@ const accentColor = useStorage(AccentColorStorageKey, 'ayanami')
628 640
629watchEffect(() => { 641watchEffect(() => {
630 if (import.meta.env.SSR) return 642 if (import.meta.env.SSR) return
631 const shades = accentPalettes[accentColor.value] ?? accentPalettes.ayanami 643 const palette = accentPalettes[accentColor.value] ?? accentPalettes.ayanami
644 const shades = 'dark' in palette
645 ? (isDark.value ? palette.dark : palette.light)
646 : palette
632 const el = document.documentElement 647 const el = document.documentElement
633 if (isDark.value) { 648 if (isDark.value) {
634 el.style.setProperty('--vp-c-brand-1', shades['400']) 649 el.style.setProperty('--vp-c-brand-1', shades['400'])
docs/.vitepress/theme/components/settings/AccentColor.vue +6 −2
@@ -1,9 +1,12 @@
1<script setup lang="ts"> 1<script setup lang="ts">
2import { useData } from 'vitepress'
2import { useStorage } from '@vueuse/core' 3import { useStorage } from '@vueuse/core'
3 4
4import { AccentColorStorageKey } from '../../constants' 5import { AccentColorStorageKey } from '../../constants'
5import MenuTitle from './MenuTitle.vue' 6import MenuTitle from './MenuTitle.vue'
6 7
8const { isDark } = useData()
9
7const accentOptions = [ 10const accentOptions = [
8 { 11 {
9 key: 'ayanami', 12 key: 'ayanami',
@@ -39,8 +42,9 @@ const accentOptions = [
39 key: 'fubuki', 42 key: 'fubuki',
40 label: 'Fubuki', 43 label: 'Fubuki',
41 shades: ['oklch(0.82 0 0)', 'oklch(0.72 0 0)', 'oklch(0.62 0 0)', 'oklch(0.52 0 0)', 'oklch(0.42 0 0)'], 44 shades: ['oklch(0.82 0 0)', 'oklch(0.72 0 0)', 'oklch(0.62 0 0)', 'oklch(0.52 0 0)', 'oklch(0.42 0 0)'],
45 lightShades: ['oklch(0.58 0 0)', 'oklch(0.48 0 0)', 'oklch(0.38 0 0)', 'oklch(0.28 0 0)', 'oklch(0.18 0 0)'],
42 }, 46 },
43] as const 47]
44 48
45const accentColor = useStorage(AccentColorStorageKey, 'ayanami') 49const accentColor = useStorage(AccentColorStorageKey, 'ayanami')
46</script> 50</script>
@@ -65,7 +69,7 @@ const accentColor = useStorage(AccentColorStorageKey, 'ayanami')
65 <span class="accent-label">{{ option.label }}</span> 69 <span class="accent-label">{{ option.label }}</span>
66 <span class="accent-shades"> 70 <span class="accent-shades">
67 <span 71 <span
68 v-for="(shade, i) in option.shades" 72 v-for="(shade, i) in ('lightShades' in option && !isDark ? option.lightShades : option.shades)"
69 :key="i" 73 :key="i"
70 class="accent-shade" 74 class="accent-shade"
71 :style="{ backgroundColor: shade }" 75 :style="{ backgroundColor: shade }"