Give every palette colour a hex value an engine without oklch can read
CI / full-gate (push) Successful in 3m5s

This commit is contained in:
2026-10-31 01:00:42 +01:00
parent eed1050c08
commit 7e3e8acb28
5 changed files with 53 additions and 20 deletions
+14
View File
@@ -0,0 +1,14 @@
import assert from "node:assert/strict";
import { readdirSync, readFileSync } from "node:fs";
import { dirname, join } from "node:path";
import { test } from "node:test";
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()`);
}
});