From 714039bae5758e374d2ab2e8dc6c760d6c73d639 Mon Sep 17 00:00:00 2001 From: Bryan Van Deusen Date: Sun, 10 May 2026 15:29:48 -0400 Subject: [PATCH] refactor(web): drive vite-injected theme-color from tokens.json (#375) Closes the last theme-color hardcode. Runtime side already imports tokens.colors.{dark,light}.obsidian via applyMetaThemeColor; build side now matches via JSON import-attributes. Drops the // TODO(#375) tripwire. Co-Authored-By: Claude Opus 4.7 (1M context) --- web/vite.config.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/web/vite.config.ts b/web/vite.config.ts index e589e3f2..38dd8300 100644 --- a/web/vite.config.ts +++ b/web/vite.config.ts @@ -1,6 +1,10 @@ import { sveltekit } from '@sveltejs/kit/vite'; import { defineConfig } from 'vite'; import { execSync } from 'node:child_process'; +import tokens from './src/lib/styles/tokens.json' with { type: 'json' }; + +const THEME_DARK = tokens.colors.dark.obsidian; +const THEME_LIGHT = tokens.colors.light.obsidian; const tokensPlugin = { name: 'minstrel-tokens', @@ -29,9 +33,8 @@ const injectGoTokensPlugin = { - - - + + `; // Fail loudly if either anchor drifts. A silent .replace() no-op