Skip to content

Commit 0489857

Browse files
author
DevBot
committed
fix(www): theme-token gate false-positives on prose words containing CSS keywords (e.g. backfills)
1 parent ebb1f00 commit 0489857

2 files changed

Lines changed: 2 additions & 1 deletion

File tree

tools/check-www-theme-tokens.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ Deno.test('theme-token gate catches short hex only in CSS contexts', () => {
2525
const prose = findThemeTokenFailures('x.tsx', [
2626
'External adopter #390 and continued browser evidence.',
2727
'<strong>#390</strong>',
28+
'Closes eight audit findings (#646–#653) and the changelog backfills a skipped hole.',
2829
]);
2930
assertEquals(prose.length, 0);
3031
});

tools/check-www-theme-tokens.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ const SCAN_ROOTS = ['www/app'];
2121
const SOURCE = /\.(ts|tsx)$/;
2222
const HEX_LONG = /#(?:[0-9a-fA-F]{6}|[0-9a-fA-F]{8})\b/;
2323
const HEX_SHORT = /#(?:[0-9a-fA-F]{3,4})\b/;
24-
const CSS_KEYWORD = /color|background|border|shadow|fill|stroke|gradient|outline/i;
24+
const CSS_KEYWORD = /\b(?:color|background|border|shadow|fill|stroke|gradient|outline)\b/i;
2525
const FONT_FAMILY = /font-family\s*:\s*([^;]+);/;
2626
const FONT_SIZE_LITERAL = /font-size\s*:\s*[0-9.]+(?:px|rem|em)\b/;
2727

0 commit comments

Comments
 (0)