refactor(web/theme): read meta-theme hex from tokens.json (B1)
This commit is contained in:
@@ -1,10 +1,13 @@
|
|||||||
|
import tokens from '$lib/styles/tokens.json';
|
||||||
import { resolvedTheme } from '$lib/stores/theme.svelte';
|
import { resolvedTheme } from '$lib/stores/theme.svelte';
|
||||||
|
|
||||||
// TODO(#375): keep these hex values in sync with tokens.json
|
// Browser address-bar tint matches the page background — colors.<mode>.obsidian
|
||||||
// colors.dark.obsidian / colors.light.obsidian. The duplication is a known
|
// is the canonical background token, the same value the runtime CSS variables
|
||||||
// drift hazard from #363; consume from the generated CSS layer instead.
|
// resolve to for each mode. Reading from tokens.json (not the generated CSS)
|
||||||
const DARK = '#14171A';
|
// avoids a getComputedStyle round-trip and keeps the source of truth in one
|
||||||
const LIGHT = '#F8F5EE';
|
// place; if a designer rotates the palette, both surfaces move together.
|
||||||
|
const DARK = tokens.colors.dark.obsidian;
|
||||||
|
const LIGHT = tokens.colors.light.obsidian;
|
||||||
|
|
||||||
// applyMetaThemeColor wires a Svelte 5 $effect that keeps a single
|
// applyMetaThemeColor wires a Svelte 5 $effect that keeps a single
|
||||||
// <meta name="theme-color"> (without a media query) in sync with the
|
// <meta name="theme-color"> (without a media query) in sync with the
|
||||||
|
|||||||
Reference in New Issue
Block a user