Answer stability round 1: 0 🔴, 2 🟡 (0 misread); explain the failure correctly and test each stylesheet

This commit is contained in:
2026-10-31 01:07:30 +01:00
parent 7e3e8acb28
commit e9a7c0e726
3 changed files with 17 additions and 9 deletions
+7 -6
View File
@@ -6,9 +6,10 @@ import { fileURLToPath } from "node:url";
const cssDir = join(dirname(fileURLToPath(import.meta.url)), "..", "..", "public", "css");
test("no stylesheet declares an oklch() colour, which an engine below Chromium 111 drops", () => {
// A dropped custom property leaves var(--accent) invalid: white text on no background.
for (const file of readdirSync(cssDir).filter((f) => f.endsWith(".css"))) {
assert.ok(!/oklch\(/.test(readFileSync(join(cssDir, file), "utf8")), `${file} declares oklch()`);
}
});
// A custom property holding oklch() passes unchecked on an engine below Chromium 111, so the
// var() that reads it is invalid at computed-value time: white text on no background.
for (const file of readdirSync(cssDir).filter((f) => f.endsWith(".css"))) {
test(`${file} declares no oklch() colour`, () => {
assert.ok(!/oklch\(/i.test(readFileSync(join(cssDir, file), "utf8")));
});
}