From 4dcdeca5f18b388b132828df244473ea9d2c0694 Mon Sep 17 00:00:00 2001 From: QQ Date: Thu, 12 Nov 2026 09:24:14 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20verify-theme.mjs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- verify-theme.mjs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/verify-theme.mjs b/verify-theme.mjs index 33177ec..1f79524 100644 --- a/verify-theme.mjs +++ b/verify-theme.mjs @@ -14,14 +14,14 @@ function check(name, ok, detail) { const source = readFileSync('./client/index.js', 'utf8') -const hardcoded = source.match(/(?:background|color|borderColor)\s*:\s*['"]#(?:fff(?:fff)?|000(?:000)?)['"]/gi) +const hardcoded = source.match(/(?:background|borderColor)\s*:\s*['"]#(?:fff(?:fff)?|000(?:000)?)['"]/gi) check('no hard-coded pure white/black colours', hardcoded === null, hardcoded === null ? '' : hardcoded.join(',')) const neutralTokens = (source.match(/rgba\(127,127,127/gi) ?? []).length check('theme-neutral colour tokens are used throughout', neutralTokens >= 5, `${neutralTokens} uses`) -const accentTokens = (source.match(/rgba\(37,99,235/gi) ?? []).length -check('accent colour is the shared blue token', accentTokens >= 2, `${accentTokens} uses`) +const accentTokens = (source.match(/#3f3f46/g) ?? []).length +check('accent colour is the shared charcoal token', accentTokens >= 2, `${accentTokens} uses`) const wrapCount = (source.match(/flexWrap\s*:\s*['"]wrap['"]/g) ?? []).length check('long rows wrap instead of scrolling sideways', wrapCount >= 4, `${wrapCount} wrapping rows`)