feat(design): switch to IMS Admin tokens, Geist and the 1px-rule gate

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-01 09:26:08 +08:00
co-authored by Claude Haiku 4.5
parent 9ed8c97c24
commit 01343d732e
18 changed files with 220 additions and 179 deletions
+3 -13
View File
@@ -2,14 +2,9 @@ import { readdirSync, readFileSync, statSync } from 'node:fs'
import path from 'node:path'
import { fileURLToPath } from 'node:url'
// Files where a circular element is legitimate (avatar). Add others only with a reason.
export const ROUND_ALLOWED = ['components/layout/sidebar.tsx']
const RULES = [
{
rule: 'no-rounded',
re: /(?<=[\s"'`:{])(?:[\w-]+:)*rounded(?:-(?!full(?![\w-]))[\w]+)*(?=[\s"'`}])/,
},
{ rule: 'no-2px-border', re: /(?<![\w-])border(?:-[tblrxy])?-2(?![\w-])/ },
{ rule: 'no-archivo', re: /Archivo/ },
{ rule: 'no-bg-white', re: /(?<![\w-])bg-white(?![\w-])/ },
{ rule: 'no-heavy-shadow', re: /(?<![\w-])shadow-(?:xl|2xl)(?![\w-])/ },
{
@@ -22,14 +17,9 @@ const RULES = [
export function findViolations(src, file) {
const out = []
const roundAllowed = ROUND_ALLOWED.includes(file)
src.split('\n').forEach((text, i) => {
const line = i + 1
for (const { rule, re } of RULES) {
if (re.test(text)) out.push({ file, line, rule, text: text.trim() })
}
if (!roundAllowed && /(?<=[\s"'`:{])(?:[\w-]+:)*rounded-full(?=[\s"'`}])/.test(text)) {
out.push({ file, line, rule: 'no-rounded-full', text: text.trim() })
if (re.test(text)) out.push({ file, line: i + 1, rule, text: text.trim() })
}
})
return out