refactor: set root layout, rename css, fix links in lint rules \ etc

This commit is contained in:
2026-09-10 19:28:22 +05:00
parent b6318f03ab
commit e970b47720
16 changed files with 76 additions and 34 deletions
+1 -1
View File
@@ -1,4 +1,4 @@
// Color authorship: every color value in preview.css must be authored as hct()
// Color authorship: every color value in app.css must be authored as hct()
// — literals AND derived forms (hct(from var(...) h c t) with channel math) —
// so the whole palette is computed through HCT channels and output as sRGB by
// the postcss-hct plugin. Exceptions: the seed tokens --brand-main/--brand-alt
+3 -3
View File
@@ -1,4 +1,4 @@
// Shared plumbing for the design-token audits: reading preview.css, scanning
// Shared plumbing for the design-token audits: reading app.css, scanning
// for var() usages across src, and the color/form predicates the checks use.
import { readdirSync, readFileSync, statSync } from "node:fs";
@@ -7,7 +7,7 @@ import { join } from "node:path";
import { fileURLToPath } from "node:url";
import postcss from "postcss";
export const FILE = new URL("../../src/preview.css", import.meta.url);
export const FILE = new URL("../../src/app.css", import.meta.url);
const SRC_DIR = fileURLToPath(new URL("../../src/", import.meta.url));
// A var(--x) REFERENCE anywhere in the app (primary argument only).
@@ -65,7 +65,7 @@ export function collectTokens(root, selector) {
return map;
}
// Parse preview.css once and hand out the postcss root plus both theme maps.
// Parse app.css once and hand out the postcss root plus both theme maps.
export async function parsePreview() {
const css = await readFile(FILE, "utf8");
const root = postcss.parse(css);
+1 -1
View File
@@ -1,4 +1,4 @@
// Unused tokens: defined in preview.css but never referenced via var()
// Unused tokens: defined in app.css but never referenced via var()
// anywhere in src. A dead token is not the single source of truth — it's dust.
// Reported as a warning; it does not fail the run.