Commit 9dcbd7c5a9
Unsigned
Layout: unified · split
docs/.vitepress/theme/Layout.vue +79 −4
| @@ -9,7 +9,8 @@ | |||
| 9 | import { | 9 | import { |
| 10 | customStorageEventName, | 10 | customStorageEventName, |
| 11 | useEventListener, | 11 | useEventListener, |
| 12 | useStorage | 12 | useStorage, |
| 13 | useThrottleFn | ||
| 13 | } from '@vueuse/core' | 14 | } from '@vueuse/core' |
| 14 | import { usePreferredReducedMotion } from '@vueuse/core' | 15 | import { usePreferredReducedMotion } from '@vueuse/core' |
| 15 | import { useData, useRoute } from 'vitepress' | 16 | import { useData, useRoute } from 'vitepress' |
| @@ -34,7 +35,7 @@ import NotFoundComponent from './components/NotFound.vue' | |||
| 34 | import { NolebaseEnhancedReadabilitiesScreenMenu } from './components/settings' | 35 | import { NolebaseEnhancedReadabilitiesScreenMenu } from './components/settings' |
| 35 | import NavActions from './components/NavActions.vue' | 36 | import NavActions from './components/NavActions.vue' |
| 36 | import SidebarCard from './components/SidebarCard.vue' | 37 | import SidebarCard from './components/SidebarCard.vue' |
| 37 | import { AccentColorStorageKey, TakodachiStorageKey } from './constants' | 38 | import { AccentBgStorageKey, AccentBgStrengthStorageKey, AccentColorStorageKey, TakodachiStorageKey } from './constants' |
| 38 | import { useEffects } from './composables/useEffects' | 39 | import { useEffects } from './composables/useEffects' |
| 39 | import { v2add, v2mag, v2norm, v2smul, v2sub, type Vec2D } from './math' | 40 | import { v2add, v2mag, v2norm, v2smul, v2sub, type Vec2D } from './math' |
| 40 | 41 | ||
| @@ -836,8 +837,52 @@ const accentPalettes: Record<string, PaletteEntry> = { | |||
| 836 | } | 837 | } |
| 837 | 838 | ||
| 838 | const accentColor = useStorage(AccentColorStorageKey, 'ayanami') | 839 | const accentColor = useStorage(AccentColorStorageKey, 'ayanami') |
| 840 | const accentBg = useStorage(AccentBgStorageKey, false) | ||
| 841 | const accentBgStrength = useStorage(AccentBgStrengthStorageKey, 60) | ||
| 842 | |||
| 843 | // Accent-tinted replacements for the neutral tokens in style.scss. | ||
| 844 | // Lightness matches the original hex values, so contrast is unchanged. | ||
| 845 | // Entries are [lightness, chroma] or [lightness, chroma, alpha]. | ||
| 846 | type TintEntry = [number, number] | [number, number, number] | ||
| 847 | const accentBgTokens: Record<'dark' | 'light', Record<string, TintEntry>> = { | ||
| 848 | dark: { | ||
| 849 | '--vp-c-bg': [0.187, 0.024], | ||
| 850 | '--vp-c-bg-alt': [0.164, 0.022], | ||
| 851 | '--vp-c-bg-elv': [0.224, 0.028], | ||
| 852 | '--vp-c-bg-soft': [0.224, 0.028], | ||
| 853 | '--vp-c-divider': [0.26, 0.032], | ||
| 854 | '--vp-c-border': [0.57, 0.02], | ||
| 855 | '--vp-c-text-1': [0.915, 0.012], | ||
| 856 | '--vp-c-text-2': [0.742, 0.012], | ||
| 857 | '--vp-c-text-3': [0.655, 0.012], | ||
| 858 | '--wk-c-menu-bg': [0.295, 0.032], | ||
| 859 | '--wk-c-nav-solid-bg': [0.2, 0.024], | ||
| 860 | '--nav-pill-bg': [0.205, 0.024, 0.7], | ||
| 861 | '--wk-fs-header-divider': [0.44, 0.02, 0.65], | ||
| 862 | }, | ||
| 863 | light: { | ||
| 864 | '--vp-c-bg': [0.986, 0.012], | ||
| 865 | '--vp-c-bg-alt': [0.958, 0.024], | ||
| 866 | '--vp-c-bg-elv': [0.958, 0.024], | ||
| 867 | '--vp-c-bg-soft': [0.958, 0.024], | ||
| 868 | '--vp-c-divider': [0.828, 0.036], | ||
| 869 | '--vp-c-border': [0.815, 0.024], | ||
| 870 | '--vp-c-gutter': [0.913, 0.02], | ||
| 871 | '--vp-c-text-1': [0.224, 0.016], | ||
| 872 | '--vp-c-text-2': [0.309, 0.014], | ||
| 873 | '--vp-c-text-3': [0.396, 0.014], | ||
| 874 | '--wk-c-menu-bg': [0.928, 0.026], | ||
| 875 | '--wk-c-nav-solid-bg': [0.986, 0.012], | ||
| 876 | '--nav-pill-bg': [0.99, 0.01, 0.8], | ||
| 877 | '--wk-fs-header-divider': [0.715, 0.02, 0.25], | ||
| 878 | }, | ||
| 879 | } | ||
| 880 | const accentBgTokenKeys = [...new Set([ | ||
| 881 | ...Object.keys(accentBgTokens.dark), | ||
| 882 | ...Object.keys(accentBgTokens.light), | ||
| 883 | ])] | ||
| 839 | 884 | ||
| 840 | watchEffect(() => { | 885 | const applyAccentTheme = () => { |
| 841 | if (import.meta.env.SSR) return | 886 | if (import.meta.env.SSR) return |
| 842 | const palette = accentPalettes[accentColor.value] ?? accentPalettes.ayanami | 887 | const palette = accentPalettes[accentColor.value] ?? accentPalettes.ayanami |
| 843 | const shades = 'dark' in palette | 888 | const shades = 'dark' in palette |
| @@ -857,7 +902,37 @@ watchEffect(() => { | |||
| 857 | el.style.setProperty('--vp-c-brand-soft', `color-mix(in srgb, ${shades['400']} 40%, transparent)`) | 902 | el.style.setProperty('--vp-c-brand-soft', `color-mix(in srgb, ${shades['400']} 40%, transparent)`) |
| 858 | el.style.setProperty('--vp-c-sidebar-active', `color-mix(in srgb, ${shades['800']} 15%, transparent)`) | 903 | el.style.setProperty('--vp-c-sidebar-active', `color-mix(in srgb, ${shades['800']} 15%, transparent)`) |
| 859 | } | 904 | } |
| 860 | }) | 905 | |
| 906 | for (const key of accentBgTokenKeys) el.style.removeProperty(key) | ||
| 907 | const userStrength = accentBg.value | ||
| 908 | ? Math.min(100, Math.max(0, Number(accentBgStrength.value) || 0)) / 100 | ||
| 909 | : 0 | ||
| 910 | if (userStrength > 0) { | ||
| 911 | const parsed = shades['500'].match(/oklch\(\s*[\d.]+\s+([\d.]+)\s+([\d.]+)/) | ||
| 912 | if (parsed) { | ||
| 913 | // Tint scales with the accent's own chroma (full tint at C >= 0.10, | ||
| 914 | // grayscale accents stay gray), then with the intensity preset. | ||
| 915 | const strength = Math.min(1, Number(parsed[1]) / 0.10) * userStrength * 1.5 | ||
| 916 | const hue = parsed[2] | ||
| 917 | const tokens = accentBgTokens[isDark.value ? 'dark' : 'light'] | ||
| 918 | for (const [key, [l, c, alpha]] of Object.entries(tokens)) { | ||
| 919 | const chroma = (c * strength).toFixed(4) | ||
| 920 | const suffix = alpha === undefined ? '' : ` / ${alpha}` | ||
| 921 | el.style.setProperty(key, `oklch(${l} ${chroma} ${hue}${suffix})`) | ||
| 922 | } | ||
| 923 | } | ||
| 924 | } | ||
| 925 | } | ||
| 926 | |||
| 927 | // Applying the tint restyles the whole page, so throttle rapid changes | ||
| 928 | // (leading + trailing: single clicks apply instantly, the last value sticks). | ||
| 929 | const applyAccentThemeThrottled = useThrottleFn(applyAccentTheme, 100, true) | ||
| 930 | |||
| 931 | watch( | ||
| 932 | [accentColor, isDark, accentBg, accentBgStrength], | ||
| 933 | () => applyAccentThemeThrottled(), | ||
| 934 | { immediate: true } | ||
| 935 | ) | ||
| 861 | 936 | ||
| 862 | const speed = 2 | 937 | const speed = 2 |
| 863 | const snapThreshold = 5 // px | 938 | const snapThreshold = 5 // px |
docs/.vitepress/theme/components/HomeFeatures.vue +4 −4
| @@ -1242,13 +1242,13 @@ html.effects-disabled .row-toggle:active { | |||
| 1242 | display: flex; | 1242 | display: flex; |
| 1243 | flex-direction: column; | 1243 | flex-direction: column; |
| 1244 | gap: 4px; | 1244 | gap: 4px; |
| 1245 | background: #e8e6ec; | 1245 | background: var(--wk-c-menu-bg); |
| 1246 | border-radius: 12px; | 1246 | border-radius: 12px; |
| 1247 | padding: 10px 12px; | 1247 | padding: 10px 12px; |
| 1248 | } | 1248 | } |
| 1249 | 1249 | ||
| 1250 | .dark .sh-option { | 1250 | .dark .sh-option { |
| 1251 | background: #2c2c31; | 1251 | background: var(--wk-c-menu-bg); |
| 1252 | } | 1252 | } |
| 1253 | 1253 | ||
| 1254 | .sh-option strong { | 1254 | .sh-option strong { |
| @@ -1284,7 +1284,7 @@ html.effects-disabled .row-toggle:active { | |||
| 1284 | } | 1284 | } |
| 1285 | 1285 | ||
| 1286 | .settings-dropdown { | 1286 | .settings-dropdown { |
| 1287 | --seg-track: #e8e6ec; | 1287 | --seg-track: var(--wk-c-menu-bg); |
| 1288 | --seg-pill-bg: var(--vp-c-bg); | 1288 | --seg-pill-bg: var(--vp-c-bg); |
| 1289 | --seg-pill-text: var(--vp-c-text-1); | 1289 | --seg-pill-text: var(--vp-c-text-1); |
| 1290 | --seg-pill-shadow: 0 2px 4px 0 #bababa8c; | 1290 | --seg-pill-shadow: 0 2px 4px 0 #bababa8c; |
| @@ -1301,7 +1301,7 @@ html.effects-disabled .row-toggle:active { | |||
| 1301 | } | 1301 | } |
| 1302 | 1302 | ||
| 1303 | .dark .settings-dropdown { | 1303 | .dark .settings-dropdown { |
| 1304 | --seg-track: #2c2c31; | 1304 | --seg-track: var(--wk-c-menu-bg); |
| 1305 | --seg-pill-bg: var(--vp-c-text-1); | 1305 | --seg-pill-bg: var(--vp-c-text-1); |
| 1306 | --seg-pill-text: var(--vp-c-bg-elv); | 1306 | --seg-pill-text: var(--vp-c-bg-elv); |
| 1307 | --seg-pill-shadow: 0 2px 4px 0 #535353db; | 1307 | --seg-pill-shadow: 0 2px 4px 0 #535353db; |
docs/.vitepress/theme/components/Search.vue +4 −4
| @@ -3614,7 +3614,7 @@ html.effects-disabled .clear-button:active { | |||
| 3614 | 3614 | ||
| 3615 | /* Settings popup card */ | 3615 | /* Settings popup card */ |
| 3616 | .search-settings-popup { | 3616 | .search-settings-popup { |
| 3617 | --seg-track: #e8e6ec; | 3617 | --seg-track: var(--wk-c-menu-bg); |
| 3618 | --seg-pill-bg: var(--vp-c-bg); | 3618 | --seg-pill-bg: var(--vp-c-bg); |
| 3619 | --seg-pill-text: var(--vp-c-text-1); | 3619 | --seg-pill-text: var(--vp-c-text-1); |
| 3620 | --seg-pill-shadow: 0 2px 4px 0 #bababa8c; | 3620 | --seg-pill-shadow: 0 2px 4px 0 #bababa8c; |
| @@ -3631,7 +3631,7 @@ html.effects-disabled .clear-button:active { | |||
| 3631 | } | 3631 | } |
| 3632 | 3632 | ||
| 3633 | .dark .search-settings-popup { | 3633 | .dark .search-settings-popup { |
| 3634 | --seg-track: #2c2c31; | 3634 | --seg-track: var(--wk-c-menu-bg); |
| 3635 | --seg-pill-bg: var(--vp-c-text-1); | 3635 | --seg-pill-bg: var(--vp-c-text-1); |
| 3636 | --seg-pill-text: var(--vp-c-bg-elv); | 3636 | --seg-pill-text: var(--vp-c-bg-elv); |
| 3637 | --seg-pill-shadow: 0 2px 4px 0 #535353db; | 3637 | --seg-pill-shadow: 0 2px 4px 0 #535353db; |
| @@ -3749,13 +3749,13 @@ html.effects-disabled .clear-button:active { | |||
| 3749 | display: flex; | 3749 | display: flex; |
| 3750 | flex-direction: column; | 3750 | flex-direction: column; |
| 3751 | gap: 4px; | 3751 | gap: 4px; |
| 3752 | background: #e8e6ec; | 3752 | background: var(--wk-c-menu-bg); |
| 3753 | border-radius: 12px; | 3753 | border-radius: 12px; |
| 3754 | padding: 10px 12px; | 3754 | padding: 10px 12px; |
| 3755 | } | 3755 | } |
| 3756 | 3756 | ||
| 3757 | .dark .sh-option { | 3757 | .dark .sh-option { |
| 3758 | background: #2c2c31; | 3758 | background: var(--wk-c-menu-bg); |
| 3759 | } | 3759 | } |
| 3760 | 3760 | ||
| 3761 | .sh-option strong { | 3761 | .sh-option strong { |
docs/.vitepress/theme/components/settings/AccentBackground.vue added +127
| @@ -0,0 +1,127 @@ | |||
| 1 | <script setup lang="ts"> | ||
| 2 | import { | ||
| 3 | NuInputHighlight, | ||
| 4 | NuInputHorizontalRadioGroup, | ||
| 5 | NuVerticalTransition | ||
| 6 | } from '@nolebase/ui' | ||
| 7 | import { useStorage } from '@vueuse/core' | ||
| 8 | import { computed, ref } from 'vue' | ||
| 9 | |||
| 10 | import MenuHelp from './MenuHelp.vue' | ||
| 11 | import MenuTitle from './MenuTitle.vue' | ||
| 12 | |||
| 13 | import { AccentBgStorageKey, AccentBgStrengthStorageKey } from '../../constants' | ||
| 14 | |||
| 15 | const menuTitleElementRef = ref<HTMLDivElement>() | ||
| 16 | const isMenuHelpPoppedUp = ref(false) | ||
| 17 | const intensityTitleElementRef = ref<HTMLDivElement>() | ||
| 18 | const isIntensityHelpPoppedUp = ref(false) | ||
| 19 | |||
| 20 | const accentBg = useStorage(AccentBgStorageKey, false) | ||
| 21 | const strengthStorageValue = useStorage(AccentBgStrengthStorageKey, 60) | ||
| 22 | |||
| 23 | const strengthValue = computed({ | ||
| 24 | get: () => { | ||
| 25 | const parsed = Number.parseInt(String(strengthStorageValue.value)) | ||
| 26 | if (Number.isNaN(parsed)) return 60 | ||
| 27 | // Snap stored values to the nearest preset. | ||
| 28 | return Math.round(Math.min(100, Math.max(20, parsed)) / 20) * 20 | ||
| 29 | }, | ||
| 30 | set: (val) => { | ||
| 31 | strengthStorageValue.value = val | ||
| 32 | } | ||
| 33 | }) | ||
| 34 | |||
| 35 | const fieldOptions = computed(() => [ | ||
| 36 | { | ||
| 37 | value: true, | ||
| 38 | title: 'On', | ||
| 39 | ariaLabel: 'On', | ||
| 40 | text: 'ON', | ||
| 41 | name: 'Accent Background Toggle Switch' | ||
| 42 | }, | ||
| 43 | { | ||
| 44 | value: false, | ||
| 45 | title: 'Off', | ||
| 46 | ariaLabel: 'Off', | ||
| 47 | text: 'OFF', | ||
| 48 | name: 'Accent Background Toggle Switch' | ||
| 49 | } | ||
| 50 | ]) | ||
| 51 | |||
| 52 | const strengthOptions = computed(() => | ||
| 53 | [20, 40, 60, 80, 100].map((v) => ({ | ||
| 54 | value: v, | ||
| 55 | title: `${v}%`, | ||
| 56 | ariaLabel: `${v}%`, | ||
| 57 | text: `${v}`, | ||
| 58 | name: 'Accent Background Strength' | ||
| 59 | })) | ||
| 60 | ) | ||
| 61 | </script> | ||
| 62 | |||
| 63 | <template> | ||
| 64 | <div space-y-2 select-none role="radiogroup"> | ||
| 65 | <div ref="menuTitleElementRef" relative flex items-center> | ||
| 66 | <MenuTitle | ||
| 67 | title="Accent Background" | ||
| 68 | aria-label="Accent Background" | ||
| 69 | flex="1" | ||
| 70 | pr-4 | ||
| 71 | > | ||
| 72 | <template #icon> | ||
| 73 | <span i-lucide:paint-roller mr-1 aria-hidden="true" /> | ||
| 74 | </template> | ||
| 75 | </MenuTitle> | ||
| 76 | <MenuHelp | ||
| 77 | v-model:is-popped-up="isMenuHelpPoppedUp" | ||
| 78 | :menu-title-element-ref="menuTitleElementRef" | ||
| 79 | > | ||
| 80 | <h4 text-md mb-1 font-semibold>Accent Background</h4> | ||
| 81 | <p text="sm" mb-2 max-w-100> | ||
| 82 | Tints backgrounds, surfaces, and text with your accent color. | ||
| 83 | </p> | ||
| 84 | </MenuHelp> | ||
| 85 | </div> | ||
| 86 | <NuInputHighlight :active="isMenuHelpPoppedUp" class="rounded-md"> | ||
| 87 | <NuInputHorizontalRadioGroup | ||
| 88 | v-model="accentBg" | ||
| 89 | bg="$vp-nolebase-enhanced-readabilities-menu-background-color" | ||
| 90 | text="sm $vp-nolebase-enhanced-readabilities-menu-text-color" | ||
| 91 | :options="fieldOptions" | ||
| 92 | /> | ||
| 93 | </NuInputHighlight> | ||
| 94 | <NuVerticalTransition :duration="200"> | ||
| 95 | <div v-show="accentBg" space-y-2 role="radiogroup"> | ||
| 96 | <div ref="intensityTitleElementRef" relative flex items-center> | ||
| 97 | <MenuTitle title="Intensity" aria-label="Intensity" flex="1" pr-4> | ||
| 98 | <template #icon> | ||
| 99 | <span | ||
| 100 | i-lucide:chart-no-axes-column-increasing | ||
| 101 | mr-1 | ||
| 102 | aria-hidden="true" | ||
| 103 | /> | ||
| 104 | </template> | ||
| 105 | </MenuTitle> | ||
| 106 | <MenuHelp | ||
| 107 | v-model:is-popped-up="isIntensityHelpPoppedUp" | ||
| 108 | :menu-title-element-ref="intensityTitleElementRef" | ||
| 109 | > | ||
| 110 | <h4 text-md mb-1 font-semibold>Intensity</h4> | ||
| 111 | <p text="sm" mb-2 max-w-100> | ||
| 112 | How strongly the accent color tints the background. | ||
| 113 | </p> | ||
| 114 | </MenuHelp> | ||
| 115 | </div> | ||
| 116 | <NuInputHighlight :active="isIntensityHelpPoppedUp" class="rounded-md"> | ||
| 117 | <NuInputHorizontalRadioGroup | ||
| 118 | v-model="strengthValue" | ||
| 119 | bg="$vp-nolebase-enhanced-readabilities-menu-background-color" | ||
| 120 | text="sm $vp-nolebase-enhanced-readabilities-menu-text-color" | ||
| 121 | :options="strengthOptions" | ||
| 122 | /> | ||
| 123 | </NuInputHighlight> | ||
| 124 | </div> | ||
| 125 | </NuVerticalTransition> | ||
| 126 | </div> | ||
| 127 | </template> | ||
docs/.vitepress/theme/components/settings/Menu.vue +4 −2
| @@ -3,6 +3,7 @@ import { useMounted } from '@vueuse/core' | |||
| 3 | import { inject } from 'vue' | 3 | import { inject } from 'vue' |
| 4 | 4 | ||
| 5 | import { InjectionKey } from '../../constants' | 5 | import { InjectionKey } from '../../constants' |
| 6 | import AccentBackground from './AccentBackground.vue' | ||
| 6 | import AccentColor from './AccentColor.vue' | 7 | import AccentColor from './AccentColor.vue' |
| 7 | import Effects from './Effects.vue' | 8 | import Effects from './Effects.vue' |
| 8 | import LayoutSwitch from './LayoutSwitch.vue' | 9 | import LayoutSwitch from './LayoutSwitch.vue' |
| @@ -33,6 +34,7 @@ const mounted = useMounted() | |||
| 33 | <SpotlightStyles v-if="!options.spotlight?.disabled" /> | 34 | <SpotlightStyles v-if="!options.spotlight?.disabled" /> |
| 34 | <Effects /> | 35 | <Effects /> |
| 35 | <Takodachi /> | 36 | <Takodachi /> |
| 37 | <AccentBackground /> | ||
| 36 | <AccentColor /> | 38 | <AccentColor /> |
| 37 | </div> | 39 | </div> |
| 38 | </SettingsFlyout> | 40 | </SettingsFlyout> |
| @@ -40,12 +42,12 @@ const mounted = useMounted() | |||
| 40 | 42 | ||
| 41 | <style> | 43 | <style> |
| 42 | .VPNolebaseEnhancedReadabilitiesMenu { | 44 | .VPNolebaseEnhancedReadabilitiesMenu { |
| 43 | --vp-nolebase-enhanced-readabilities-menu-background-color: #e8e6ec; | 45 | --vp-nolebase-enhanced-readabilities-menu-background-color: var(--wk-c-menu-bg); |
| 44 | --vp-nolebase-enhanced-readabilities-menu-text-color: var(--vp-c-text-1); | 46 | --vp-nolebase-enhanced-readabilities-menu-text-color: var(--vp-c-text-1); |
| 45 | } | 47 | } |
| 46 | 48 | ||
| 47 | .dark .VPNolebaseEnhancedReadabilitiesMenu { | 49 | .dark .VPNolebaseEnhancedReadabilitiesMenu { |
| 48 | --vp-nolebase-enhanced-readabilities-menu-background-color: #2c2c31; | 50 | --vp-nolebase-enhanced-readabilities-menu-background-color: var(--wk-c-menu-bg); |
| 49 | --vp-nolebase-enhanced-readabilities-menu-text-color: var(--vp-c-text-1); | 51 | --vp-nolebase-enhanced-readabilities-menu-text-color: var(--vp-c-text-1); |
| 50 | } | 52 | } |
| 51 | 53 | ||
docs/.vitepress/theme/components/settings/ScreenMenu.vue +4 −2
| @@ -3,6 +3,7 @@ import { useMounted } from '@vueuse/core' | |||
| 3 | import { useData } from 'vitepress' | 3 | import { useData } from 'vitepress' |
| 4 | import VPSocialLinks from 'vitepress/dist/client/theme-default/components/VPSocialLinks.vue' | 4 | import VPSocialLinks from 'vitepress/dist/client/theme-default/components/VPSocialLinks.vue' |
| 5 | 5 | ||
| 6 | import AccentBackground from './AccentBackground.vue' | ||
| 6 | import AccentColor from './AccentColor.vue' | 7 | import AccentColor from './AccentColor.vue' |
| 7 | import Effects from './Effects.vue' | 8 | import Effects from './Effects.vue' |
| 8 | 9 | ||
| @@ -13,6 +14,7 @@ const { theme } = useData() | |||
| 13 | <template> | 14 | <template> |
| 14 | <div v-if="mounted" space-y-2 class="VPNolebaseEnhancedReadabilitiesMenu"> | 15 | <div v-if="mounted" space-y-2 class="VPNolebaseEnhancedReadabilitiesMenu"> |
| 15 | <Effects /> | 16 | <Effects /> |
| 17 | <AccentBackground /> | ||
| 16 | <AccentColor /> | 18 | <AccentColor /> |
| 17 | <VPSocialLinks | 19 | <VPSocialLinks |
| 18 | v-if="theme.socialLinks" | 20 | v-if="theme.socialLinks" |
| @@ -24,12 +26,12 @@ const { theme } = useData() | |||
| 24 | 26 | ||
| 25 | <style> | 27 | <style> |
| 26 | .VPNolebaseEnhancedReadabilitiesMenu { | 28 | .VPNolebaseEnhancedReadabilitiesMenu { |
| 27 | --vp-nolebase-enhanced-readabilities-menu-background-color: #e8e6ec; | 29 | --vp-nolebase-enhanced-readabilities-menu-background-color: var(--wk-c-menu-bg); |
| 28 | --vp-nolebase-enhanced-readabilities-menu-text-color: var(--vp-c-text-1); | 30 | --vp-nolebase-enhanced-readabilities-menu-text-color: var(--vp-c-text-1); |
| 29 | } | 31 | } |
| 30 | 32 | ||
| 31 | .dark .VPNolebaseEnhancedReadabilitiesMenu { | 33 | .dark .VPNolebaseEnhancedReadabilitiesMenu { |
| 32 | --vp-nolebase-enhanced-readabilities-menu-background-color: #2c2c31; | 34 | --vp-nolebase-enhanced-readabilities-menu-background-color: var(--wk-c-menu-bg); |
| 33 | --vp-nolebase-enhanced-readabilities-menu-text-color: var(--vp-c-text-1); | 35 | --vp-nolebase-enhanced-readabilities-menu-text-color: var(--vp-c-text-1); |
| 34 | } | 36 | } |
| 35 | </style> | 37 | </style> |
docs/.vitepress/theme/constants.ts +3
| @@ -29,6 +29,9 @@ export const SpotlightStylesStorageKey = | |||
| 29 | export const EffectsStorageKey = 'preference-effects' | 29 | export const EffectsStorageKey = 'preference-effects' |
| 30 | export const TakodachiStorageKey = 'preference-takodachi' | 30 | export const TakodachiStorageKey = 'preference-takodachi' |
| 31 | export const AccentColorStorageKey = 'preference-accent-color' | 31 | export const AccentColorStorageKey = 'preference-accent-color' |
| 32 | export const AccentBgStorageKey = 'preference-accent-bg' | ||
| 33 | /** Accent background tint strength, 0–100. */ | ||
| 34 | export const AccentBgStrengthStorageKey = 'preference-accent-bg-strength' | ||
| 32 | 35 | ||
| 33 | export enum LayoutMode { | 36 | export enum LayoutMode { |
| 34 | FullWidth = 1, | 37 | FullWidth = 1, |
docs/.vitepress/theme/styles/style.scss +21 −1
| @@ -22,6 +22,10 @@ $ease-in-expo: cubic-bezier(0.7, 0, 0.84, 0); | |||
| 22 | --vp-c-text-3: #46464a; | 22 | --vp-c-text-3: #46464a; |
| 23 | /* Divider under the mobile full-screen header bars. */ | 23 | /* Divider under the mobile full-screen header bars. */ |
| 24 | --wk-fs-header-divider: rgba(163, 163, 163, 0.25); | 24 | --wk-fs-header-divider: rgba(163, 163, 163, 0.25); |
| 25 | /* Flat menu/option surfaces (settings menu, search help cards). */ | ||
| 26 | --wk-c-menu-bg: #e8e6ec; | ||
| 27 | /* Solid nav-pill segment background when effects (blur) are off. */ | ||
| 28 | --wk-c-nav-solid-bg: var(--vp-c-bg); | ||
| 25 | } | 29 | } |
| 26 | 30 | ||
| 27 | .dark { | 31 | .dark { |
| @@ -36,6 +40,8 @@ $ease-in-expo: cubic-bezier(0.7, 0, 0.84, 0); | |||
| 36 | --vp-c-text-2: #ababaf; | 40 | --vp-c-text-2: #ababaf; |
| 37 | --vp-c-text-3: #919094; | 41 | --vp-c-text-3: #919094; |
| 38 | --wk-fs-header-divider: rgba(82, 82, 82, 0.65); | 42 | --wk-fs-header-divider: rgba(82, 82, 82, 0.65); |
| 43 | --wk-c-menu-bg: #2c2c31; | ||
| 44 | --wk-c-nav-solid-bg: #151617; | ||
| 39 | } | 45 | } |
| 40 | 46 | ||
| 41 | :root { | 47 | :root { |
| @@ -125,6 +131,20 @@ $ease-in-expo: cubic-bezier(0.7, 0, 0.84, 0); | |||
| 125 | --nav-pill-border: rgb(212 212 212 / 0.1); | 131 | --nav-pill-border: rgb(212 212 212 / 0.1); |
| 126 | } | 132 | } |
| 127 | 133 | ||
| 134 | /* Nolebase sliders hardcode #fff / #e1e2da for the thumb and progress fill; | ||
| 135 | use theme tokens (like the radio pills) so they follow the theme. */ | ||
| 136 | .nolebase-ui-slider { | ||
| 137 | --nolebase-ui-slider-thumb-color: var(--vp-c-bg); | ||
| 138 | --nolebase-ui-slider-track-color: var(--vp-c-bg); | ||
| 139 | --nolebase-ui-slider-track-progress-color: var(--vp-c-bg); | ||
| 140 | } | ||
| 141 | |||
| 142 | .dark .nolebase-ui-slider { | ||
| 143 | --nolebase-ui-slider-thumb-color: var(--vp-c-text-1); | ||
| 144 | --nolebase-ui-slider-track-color: var(--vp-c-text-1); | ||
| 145 | --nolebase-ui-slider-track-progress-color: var(--vp-c-text-1); | ||
| 146 | } | ||
| 147 | |||
| 128 | .dark { | 148 | .dark { |
| 129 | /* Colors: Brand */ | 149 | /* Colors: Brand */ |
| 130 | --vp-c-brand-1: theme("colors.brand.400"); | 150 | --vp-c-brand-1: theme("colors.brand.400"); |
| @@ -1626,7 +1646,7 @@ html.effects-disabled { | |||
| 1626 | .VPSocialLinks.VPNavBarSocialLinks.social-links, | 1646 | .VPSocialLinks.VPNavBarSocialLinks.social-links, |
| 1627 | .nav-actions, | 1647 | .nav-actions, |
| 1628 | .VPNolebaseEnhancedReadabilitiesMenuFlyout { | 1648 | .VPNolebaseEnhancedReadabilitiesMenuFlyout { |
| 1629 | background-color: #151617 !important; | 1649 | background-color: var(--wk-c-nav-solid-bg) !important; |
| 1630 | } | 1650 | } |
| 1631 | } | 1651 | } |
| 1632 | 1652 | ||