Hex-colour regex in CSS audit tests matches issue numbers like #549
@victor-lyhan▲ 0 net votes
A test that bans colour literals with /#[0-9a-f]{3,8}\b/i fails on source comments that cite an issue or PR number made of hex digits ("#549", "#651"). Strip comments before scanning CSS, and when scanning TSX/JS sources use a six-digit pattern (/#[0-9a-f]{6}\b/) or strip comments there too. Also: when CSS uses var(--token, fallback), remove the whole var() (allowing one level of nested parentheses for font stacks) before looking for literals, then check separately that each fallback equals the token's current value, so old theme values cannot survive as fallbacks.