Skip to content

Commit d6eb155

Browse files
prc5claude
andcommitted
style: 💄 make destructive color visible in dark mode
Dark-mode --destructive was the old shadcn preview value, a near-black red with 1.7:1 contrast, and buttons blended it to 60% opacity on top of that. Use a bright red in dark mode, drop the 60% blend so destructive buttons and badges render solid, and set --destructive-foreground to white. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
1 parent 62b402f commit d6eb155

11 files changed

Lines changed: 19 additions & 19 deletions

File tree

‎apps/admin/src/assets/styles.css‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@
131131
--accent: oklch(0.96 0.008 75);
132132
--accent-foreground: oklch(0.22 0.01 75);
133133
--destructive: oklch(0.577 0.245 27.325);
134-
--destructive-foreground: oklch(0.577 0.245 27.325);
134+
--destructive-foreground: oklch(0.985 0 0);
135135
--border: oklch(0.92 0.008 75);
136136
--input: oklch(0.92 0.008 75);
137137
--ring: oklch(0.87 0.01 75);
@@ -174,8 +174,8 @@
174174
--muted-foreground: oklch(0.72 0.008 75);
175175
--accent: oklch(0.3 0.008 75);
176176
--accent-foreground: oklch(0.985 0 0);
177-
--destructive: oklch(0.396 0.141 25.723);
178-
--destructive-foreground: oklch(0.637 0.237 25.331);
177+
--destructive: oklch(0.64 0.22 27);
178+
--destructive-foreground: oklch(0.985 0 0);
179179
--border: oklch(0.3 0.008 75);
180180
--input: oklch(0.3 0.008 75);
181181
--ring: oklch(0.42 0.015 75);

‎apps/admin/src/components/ui/badge.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ const badgeVariants = cva(
1212
default: "border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90",
1313
secondary: "border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",
1414
destructive:
15-
"border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",
15+
"border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40",
1616
outline: "text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground",
1717
},
1818
size: {

‎apps/admin/src/components/ui/button.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ const buttonVariants = cva(
1212
default:
1313
"bg-gradient-to-b from-primary to-primary/80 text-primary-foreground shadow-xs hover:from-primary/90 hover:to-primary/70",
1414
destructive:
15-
"bg-destructive text-white shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",
15+
"bg-destructive text-white shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40",
1616
outline:
1717
"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",
1818
secondary: "bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80",

‎apps/extension/src/assets/styles.css‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@
131131
--accent: oklch(0.96 0.008 75);
132132
--accent-foreground: oklch(0.22 0.01 75);
133133
--destructive: oklch(0.577 0.245 27.325);
134-
--destructive-foreground: oklch(0.577 0.245 27.325);
134+
--destructive-foreground: oklch(0.985 0 0);
135135
--border: oklch(0.92 0.008 75);
136136
--input: oklch(0.92 0.008 75);
137137
--ring: oklch(0.87 0.01 75);
@@ -174,8 +174,8 @@
174174
--muted-foreground: oklch(0.72 0.008 75);
175175
--accent: oklch(0.3 0.008 75);
176176
--accent-foreground: oklch(0.985 0 0);
177-
--destructive: oklch(0.396 0.141 25.723);
178-
--destructive-foreground: oklch(0.637 0.237 25.331);
177+
--destructive: oklch(0.64 0.22 27);
178+
--destructive-foreground: oklch(0.985 0 0);
179179
--border: oklch(0.3 0.008 75);
180180
--input: oklch(0.3 0.008 75);
181181
--ring: oklch(0.42 0.015 75);

‎apps/extension/src/components/ui/badge.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ const badgeVariants = cva(
1212
default: "border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90",
1313
secondary: "border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",
1414
destructive:
15-
"border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",
15+
"border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40",
1616
outline: "text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground",
1717
},
1818
size: {

‎apps/extension/src/components/ui/button.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ const buttonVariants = cva(
1212
default:
1313
"bg-gradient-to-b from-primary to-primary/80 text-primary-foreground shadow-xs hover:from-primary/90 hover:to-primary/70",
1414
destructive:
15-
"bg-destructive text-white shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",
15+
"bg-destructive text-white shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40",
1616
outline:
1717
"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",
1818
secondary: "bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80",

‎apps/frontend/src/assets/styles.css‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@
131131
--accent: oklch(0.96 0.008 75);
132132
--accent-foreground: oklch(0.22 0.01 75);
133133
--destructive: oklch(0.577 0.245 27.325);
134-
--destructive-foreground: oklch(0.577 0.245 27.325);
134+
--destructive-foreground: oklch(0.985 0 0);
135135
--border: oklch(0.92 0.008 75);
136136
--input: oklch(0.92 0.008 75);
137137
--ring: oklch(0.87 0.01 75);
@@ -174,8 +174,8 @@
174174
--muted-foreground: oklch(0.72 0.008 75);
175175
--accent: oklch(0.3 0.008 75);
176176
--accent-foreground: oklch(0.985 0 0);
177-
--destructive: oklch(0.396 0.141 25.723);
178-
--destructive-foreground: oklch(0.637 0.237 25.331);
177+
--destructive: oklch(0.64 0.22 27);
178+
--destructive-foreground: oklch(0.985 0 0);
179179
--border: oklch(0.3 0.008 75);
180180
--input: oklch(0.3 0.008 75);
181181
--ring: oklch(0.42 0.015 75);

‎apps/frontend/src/components/ui/badge.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ const badgeVariants = cva(
1212
default: "border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90",
1313
secondary: "border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",
1414
destructive:
15-
"border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",
15+
"border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40",
1616
outline: "text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground",
1717
},
1818
size: {

‎apps/frontend/src/components/ui/button.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ const buttonVariants = cva(
1212
default:
1313
"bg-gradient-to-b from-primary to-primary/80 text-primary-foreground shadow-xs hover:from-primary/90 hover:to-primary/70",
1414
destructive:
15-
"bg-destructive text-white shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",
15+
"bg-destructive text-white shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40",
1616
outline:
1717
"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",
1818
secondary: "bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80",

‎apps/mobile/src/components/ui/button.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ const buttonVariants = cva(
1919
Platform.select({ web: "hover:bg-primary/90" }),
2020
),
2121
destructive: cn(
22-
"bg-destructive active:bg-destructive/90 dark:bg-destructive/60 shadow-sm shadow-black/5",
22+
"bg-destructive active:bg-destructive/90 shadow-sm shadow-black/5",
2323
Platform.select({
2424
web: "hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40",
2525
}),

0 commit comments

Comments
 (0)