Keep approved Dock and add row feedback with stable themed scrollbars

This commit is contained in:
SantaSpeen committed 2026-11-30 19:46:34 +03:00
1 parent c41a5e4276
commit 645afe3ebf
101 files changed
+580 -1348

No files matched your search

+32 -4
View File
@@ -1,8 +1,11 @@
import assert from "node:assert/strict";
import { readFile, mkdir, writeFile } from "node:fs/promises";
import { concepts, tokensFor, cssVars } from "../concepts/registry.js";
assert.equal(concepts.length, 6);
assert.equal(new Set(concepts.map((c) => c.layout)).size, 6);
assert.deepEqual(
concepts.map((c) => c.id),
["dock"],
);
assert.equal(concepts[0].layout, "rail");
const luminance = (hex) =>
hex
.match(/\w\w/g)
@@ -18,7 +21,12 @@ for (const c of concepts)
for (const theme of ["light", "dark"])
for (const density of ["compact", "normal", "relaxed"]) {
const t = tokensFor(c.id, theme, undefined, density);
for (const bg of ["color.bg", "color.surface"])
for (const bg of [
"color.bg",
"color.surface",
"color.row-hover",
"color.row-active",
])
for (const fg of [
"color.text",
"color.muted",
@@ -32,6 +40,26 @@ for (const c of concepts)
);
assert.ok(contrast(t["color.accent"], t["color.on-accent"]) >= 4.5);
}
for (const theme of ["light", "dark"])
for (const accent of [
"#ffcc00",
"#000000",
"#ffffff",
"#27634c",
"#ff0055",
]) {
const tokens = tokensFor("dock", theme, accent);
for (const bg of [
"color.bg",
"color.surface",
"color.row-hover",
"color.row-active",
])
assert.ok(
contrast(tokens["color.accent"], tokens[bg]) >= 4.5,
`${theme}/${accent}/${bg} custom accent`,
);
}
for (const c of concepts)
for (const theme of ["light", "dark"]) {
const tokens = tokensFor(c.id, theme);
@@ -54,5 +82,5 @@ for (const file of [
])
assert.ok((await readFile(file, "utf8")).length > 100);
console.log(
"PASS: six layout grammars, 36 token sets, default text contrast, generated CSS/JSON.",
"PASS: approved Dock, 6 token configurations, default text contrast, generated CSS/JSON.",
);