fix(01-design-tokens-rams-foundation): CR-01 drive bare rounded via deprecated --radius key (0px)

This commit is contained in:
araharah-executor
2026-10-22 09:34:45 +08:00
parent 67df693268
commit 61d15c28a8
3 changed files with 63 additions and 5 deletions
+4 -1
View File
@@ -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)`);