Critical is a shadcn/ui theme built around a muted deep red primary color (#3e2e30) with muted deep blue accents (#2e303e). The light mode uses a neutral background (#ffffff). Dark mode keeps the muted deep red primary (#3e2e30) on a neutral background (#040102).
| Token | Light | Dark |
|---|---|---|
| Background | #ffffffwhite | #040102black |
| Foreground | #160306black | #f8f6f7whitesmoke |
| Card | #ffffffwhite | #040102black |
| Card foreground | #160306black | #f8f6f7whitesmoke |
| Popover | #ffffffwhite | #040102black |
| Popover foreground | #160306black | #f8f6f7whitesmoke |
| Primary | #3e2e30darkslategray | #3e2e30darkslategray |
| Primary foreground | #d6c7c9lightgrey | #d6c7c9lightgrey |
| Secondary | #303e2edarkslategray | #303e2edarkslategray |
| Secondary foreground | #c9d6c7lightgrey | #c9d6c7lightgrey |
| Muted | #dbeed8gainsboro | #142711black |
| Muted foreground | #464946darkslategray | #b7b9b6silver |
| Accent | #2e303edarkslategray | #2e303edarkslategray |
| Accent foreground | #c7c9d6lightgrey | #c7c9d6lightgrey |
| Destructive | #973602saddlebrown | #fb6413orangered |
| Destructive foreground | #ffffffwhite | #000000black |
| Border | #e5e7eblavender | #1f2937darkslategray |
| Input | #e5e7eblavender | #1f2937darkslategray |
| Ring | #3e2e30darkslategray | #3e2e30darkslategray |
WCAG 2 contrast ratios between each background and its foreground color.
| Text on background | 20.00:1 | AAA |
| Text on card | 20.00:1 | AAA |
| Primary button | 7.90:1 | AAA |
| Secondary button | 7.55:1 | AAA |
| Muted text | 7.47:1 | AAA |
| Accent | 7.97:1 | AAA |
| Destructive | 7.38:1 | AAA |
| Text on background | 19.30:1 | AAA |
| Text on card | 19.30:1 | AAA |
| Primary button | 7.90:1 | AAA |
| Secondary button | 7.55:1 | AAA |
| Muted text | 8.02:1 | AAA |
| Accent | 7.97:1 | AAA |
| Destructive | 6.95:1 | AA |
Paste this into your globals.css to use Critical in your shadcn/ui project.
:root {
--radius: 0.5rem;
--background: oklch(1 0 180);
--foreground: oklch(0.142 0.038 11.859);
--muted: oklch(0.928 0.035 141.487);
--muted-foreground: oklch(0.401 0.006 141.552);
--popover: oklch(1 0 180);
--popover-foreground: oklch(0.142 0.038 11.859);
--card: oklch(1 0 180);
--card-foreground: oklch(0.142 0.038 11.859);
--border: oklch(0.928 0.006 264.531);
--input: oklch(0.928 0.006 264.531);
--primary: oklch(0.318 0.024 9.573);
--primary-foreground: oklch(0.843 0.016 8.225);
--secondary: oklch(0.345 0.033 141.325);
--secondary-foreground: oklch(0.862 0.024 141.514);
--accent: oklch(0.312 0.025 277.994);
--accent-foreground: oklch(0.839 0.018 279.018);
--destructive: oklch(0.466 0.14 41.734);
--destructive-foreground: oklch(1 0 180);
--ring: oklch(0.318 0.024 9.573);
--chart-1: oklch(0.318 0.024 9.573);
--chart-2: oklch(0.345 0.033 141.325);
--chart-3: oklch(0.312 0.025 277.994);
--chart-4: oklch(0.376 0.037 141.319);
--chart-5: oklch(0.316 0.029 9.975);
}
.dark {
--radius: 0.5rem;
--background: oklch(0.084 0.013 8.627);
--foreground: oklch(0.976 0.002 7.807);
--muted: oklch(0.249 0.046 141.125);
--muted-foreground: oklch(0.783 0.005 141.575);
--popover: oklch(0.084 0.013 8.627);
--popover-foreground: oklch(0.976 0.002 7.807);
--card: oklch(0.084 0.013 8.627);
--card-foreground: oklch(0.976 0.002 7.807);
--border: oklch(0.278 0.03 256.848);
--input: oklch(0.278 0.03 256.848);
--primary: oklch(0.318 0.024 9.573);
--primary-foreground: oklch(0.843 0.016 8.225);
--secondary: oklch(0.345 0.033 141.325);
--secondary-foreground: oklch(0.862 0.024 141.514);
--accent: oklch(0.312 0.025 277.994);
--accent-foreground: oklch(0.839 0.018 279.018);
--destructive: oklch(0.689 0.201 42.3);
--destructive-foreground: oklch(0 0 0);
--ring: oklch(0.318 0.024 9.573);
--chart-1: oklch(0.318 0.024 9.573);
--chart-2: oklch(0.345 0.033 141.325);
--chart-3: oklch(0.312 0.025 277.994);
--chart-4: oklch(0.376 0.037 141.319);
--chart-5: oklch(0.316 0.029 9.975);
}