fix: enforce semantic contrast across admin
Local Build and Deploy / deploy (push) Successful in 44s

This commit is contained in:
Simo committed 2026-07-12 15:14:15 +02:00
1 parent 45c8178cfa
commit f0b4bc1630
86 files changed
+438 -338

No files matched your search

+18
View File
@@ -86,6 +86,24 @@ describe("derivePublicForegrounds", () => {
}
});
it("covers admin hierarchy and every semantic status", () => {
const required = [
"subtle", "disabled", "sidebar", "input",
"success-text", "success-solid", "warning-text", "warning-solid",
"error-text", "error-solid", "info-text", "info-solid",
];
for (const preset of Object.values(PRESETS)) {
for (const palette of [preset.light, preset.dark]) {
const result = derivePublicForegrounds(palette);
for (const name of required) {
const pair = result.pairs.find((candidate) => candidate.name === name);
expect(pair, `missing ${name}`).toBeDefined();
expect(contrastRatio(pair!.foreground, pair!.background), name).toBeGreaterThanOrEqual(4.5);
}
}
}
});
it("repairs hostile white-on-white custom colors", () => {
const result = derivePublicForegrounds({
color_background: "#ffffff", color_surface: "#ffffff", color_dropdown: "#ffffff",