Skip to content

Open-source manufacturing ERP, MES and QMS. Quoting, MRP, inventory, shop floor, quality and lot/serial traceability on one Postgres schema, with a REST API and MCP server. Self-host or use Carbon Cloud.

fix(ui): every dark theme's destructive red reads as text

Raul4d0ae9894c31
diff --git a/packages/utils/src/themes.test.ts b/packages/utils/src/themes.test.ts
index 175bcd0ae6..5d28e6ed87 100644
--- a/packages/utils/src/themes.test.ts
+++ b/packages/utils/src/themes.test.ts
@@ -55,13 +55,16 @@ describe("destructive colour contrast", () => {
}
);
- it("zinc dark: destructive text on every surface", () => {
- const vars = themes.find((t) => t.name === "zinc")!.cssVars.dark;
- for (const surface of SURFACES) {
- expect(
- contrast(vars.destructive, vars[surface]),
- surface
- ).toBeGreaterThanOrEqual(TEXT);
+ it.each(themes.map((theme) => theme.name))(
+ "%s dark: destructive text on every surface",
+ (name) => {
+ const vars = themes.find((t) => t.name === name)!.cssVars.dark;
+ for (const surface of SURFACES) {
+ expect(
+ contrast(vars.destructive, vars[surface]),
+ surface
+ ).toBeGreaterThanOrEqual(TEXT);
+ }
}
- });
+ );
});
diff --git a/packages/utils/src/themes.ts b/packages/utils/src/themes.ts
index 1164fc3ceb..968286fd1d 100644
--- a/packages/utils/src/themes.ts
+++ b/packages/utils/src/themes.ts
@@ -116,8 +116,8 @@ export const themes = [
"muted-foreground": "0 0% 63.9%",
accent: "0 0% 14.9%",
"accent-foreground": "0 0% 98%",
- destructive: "0 62.8% 30.6%",
- "destructive-foreground": "0 0% 98%",
+ destructive: "0 100% 64%",
+ "destructive-foreground": "0 0% 0%",
border: "0 0% 14.9%",
input: "0 0% 14.9%",
ring: "0 0% 83.1%",
@@ -176,8 +176,8 @@ export const themes = [
"muted-foreground": "0 0% 63.9%",
accent: "0 0% 14.9%",
"accent-foreground": "0 0% 98%",
- destructive: "0 62.8% 30.6%",
- "destructive-foreground": "0 0% 98%",
+ destructive: "0 100% 64%",
+ "destructive-foreground": "0 0% 0%",
border: "0 0% 14.9%",
input: "0 0% 14.9%",
ring: "0 72.2% 50.6%",
@@ -236,8 +236,8 @@ export const themes = [
"muted-foreground": "24 5.4% 63.9%",
accent: "12 6.5% 15.1%",
"accent-foreground": "60 9.1% 97.8%",
- destructive: "0 72.2% 50.6%",
- "destructive-foreground": "60 9.1% 97.8%",
+ destructive: "0 100% 64%",
+ "destructive-foreground": "0 0% 0%",
border: "12 6.5% 15.1%",
input: "12 6.5% 15.1%",
ring: "17 96% 57%",
@@ -297,8 +297,8 @@ export const themes = [
"muted-foreground": "24 5.4% 63.9%",
accent: "12 6.5% 15.1%",
"accent-foreground": "65 9.1% 97.8%",
- destructive: "0 62.8% 30.6%",
- "destructive-foreground": "65 9.1% 97.8%",
+ destructive: "0 100% 64%",
+ "destructive-foreground": "0 0% 0%",
border: "12 6.5% 15.1%",
input: "12 6.5% 15.1%",
ring: "65 91.7% 32.9%",
@@ -358,8 +358,8 @@ export const themes = [
"muted-foreground": "171 5% 64.9%",
accent: "171 6.5% 15.1%",
"accent-foreground": "0 0% 98%",
- destructive: "0 62.8% 30.6%",
- "destructive-foreground": "0 85.7% 97.3%",
+ destructive: "0 100% 64%",
+ "destructive-foreground": "0 0% 0%",
border: "171 3.7% 15.9%",
input: "171 3.7% 15.9%",
ring: "171 71.8% 29.2%",
@@ -418,8 +418,8 @@ export const themes = [
"muted-foreground": "220 5% 64.9%",
accent: "220 10% 15.9%",
"accent-foreground": "0 0% 98%",
- destructive: "0 62.8% 30.6%",
- "destructive-foreground": "0 85.7% 97.3%",
+ destructive: "0 100% 64%",
+ "destructive-foreground": "0 0% 0%",
border: "220 10% 15.9%",
input: "220 10% 15.9%",
ring: "216 71.8% 29.2%",
@@ -478,8 +478,8 @@ export const themes = [
"muted-foreground": "217.9 10.6% 64.9%",
accent: "263 27.9% 12.9%",
"accent-foreground": "210 20% 98%",
- destructive: "0 62.8% 30.6%",
- "destructive-foreground": "210 20% 98%",
+ destructive: "0 100% 64%",
+ "destructive-foreground": "0 0% 0%",
border: "263 27.9% 16.9%",
input: "263 27.9% 16.9%",
ring: "263.4 70% 50.4%",