From 61d15c28a84ced83103c63de0370530f42fc39cd Mon Sep 17 00:00:00 2001 From: araharah-executor Date: Thu, 22 Oct 2026 09:34:45 +0800 Subject: [PATCH] fix(01-design-tokens-rams-foundation): CR-01 drive bare rounded via deprecated --radius key (0px) --- theme/scripts/audit.mjs | 5 +++- theme/scripts/audit.test.mjs | 53 +++++++++++++++++++++++++++++++++++- theme/src/tokens.css | 10 +++++-- 3 files changed, 63 insertions(+), 5 deletions(-) diff --git a/theme/scripts/audit.mjs b/theme/scripts/audit.mjs index 7b2999e..823e46b 100644 --- a/theme/scripts/audit.mjs +++ b/theme/scripts/audit.mjs @@ -170,7 +170,10 @@ function parseTokens(path) { } let radiusCount = 0; - for (const m of text.matchAll(/--radius-[A-Za-z0-9-]*\s*:\s*([^;}]+?)\s*;/g)) { + /* (?:-[A-Za-z0-9-]*)? — also matches the deprecated bare --radius key + * that drives the bare `rounded` utility, so a future non-zero bare + * key override cannot escape the drift guard. */ + for (const m of text.matchAll(/--radius(?:-[A-Za-z0-9-]*)?\s*:\s*([^;}]+?)\s*;/g)) { radiusCount++; if (!/^0*\.?0*(px|rem|em)?$/.test(m[1].trim())) { fail(2, `radius token --radius-…: ${m[1].trim()} is not zero — Rams requires absolute zero roundedness (design doc, Shapes)`); diff --git a/theme/scripts/audit.test.mjs b/theme/scripts/audit.test.mjs index 23e840d..1fac233 100644 --- a/theme/scripts/audit.test.mjs +++ b/theme/scripts/audit.test.mjs @@ -27,9 +27,13 @@ * T8 inline style="…" attributes on implementation * pages are audited too (no evasion path around * the