Necessary is a shadcn/ui theme built around a light pink primary color (#fbf4f9) with muted light pink accents (#cfc4cb). The light mode uses a neutral background (#ffffff). Dark mode keeps the light pink primary (#fbf4f9) on a neutral background (#040103).
| Token | Light | Dark |
|---|---|---|
| Background | #ffffffwhite | #040103black |
| Foreground | #13060fblack | #fdfcfdwhite |
| Card | #fcfcfcsnow | #080306black |
| Card foreground | #0f050cblack | #ffffffwhite |
| Popover | #fcfcfcsnow | #080306black |
| Popover foreground | #0f050cblack | #ffffffwhite |
| Primary | #fbf4f9lavenderblush | #fbf4f9lavenderblush |
| Primary foreground | #8a336dpurple | #8a336dpurple |
| Secondary | #d7d5d6lightgrey | #1f191dblack |
| Secondary foreground | #3e3c3edarkslategray | #bdadb8silver |
| Muted | #f4e6f0linen | #190b14black |
| Muted foreground | #5d565adimgray | #a9a2a7darkgray |
| Accent | #cfc4cbthistle | #3e2837darkslategray |
| Accent foreground | #352c32darkslategray | #d7c1d0thistle |
| Destructive | #ba470dsienna | #f17232tomato |
| Destructive foreground | #ffffffwhite | #000000black |
| Border | #e5e7eblavender | #1f2937darkslategray |
| Input | #e5e7eblavender | #1f2937darkslategray |
| Ring | #fbf4f9lavenderblush | #fbf4f9lavenderblush |
WCAG 2 contrast ratios between each background and its foreground color.
| Text on background | 19.79:1 | AAA |
| Text on card | 19.61:1 | AAA |
| Primary button | 6.98:1 | AA |
| Secondary button | 7.50:1 | AAA |
| Muted text | 5.91:1 | AA |
| Accent | 7.97:1 | AAA |
| Destructive | 5.27:1 | AA |
| Text on background | 20.27:1 | AAA |
| Text on card | 20.51:1 | AAA |
| Primary button | 6.98:1 | AA |
| Secondary button | 8.09:1 | AAA |
| Muted text | 7.66:1 | AAA |
| Accent | 7.94:1 | AAA |
| Destructive | 7.16:1 | AAA |
Paste this into your globals.css to use Necessary in your shadcn/ui project.
:root {
--radius: 0.5rem;
--background: oklch(1 0 180);
--foreground: oklch(0.15 0.03 340.316);
--muted: oklch(0.939 0.02 337.687);
--muted-foreground: oklch(0.46 0.012 337.778);
--popover: oklch(0.992 0 161.565);
--popover-foreground: oklch(0.137 0.026 339.322);
--card: oklch(0.992 0 161.565);
--card-foreground: oklch(0.137 0.026 339.322);
--border: oklch(0.928 0.006 264.531);
--input: oklch(0.928 0.006 264.531);
--primary: oklch(0.973 0.01 337.465);
--primary-foreground: oklch(0.463 0.136 342.918);
--secondary: oklch(0.876 0.002 337.318);
--secondary-foreground: oklch(0.359 0.004 337.507);
--accent: oklch(0.831 0.015 337.634);
--accent-foreground: oklch(0.305 0.018 338.409);
--destructive: oklch(0.547 0.161 41.434);
--destructive-foreground: oklch(1 0 180);
--ring: oklch(0.973 0.01 337.465);
--chart-1: oklch(0.973 0.01 337.465);
--chart-2: oklch(0.876 0.002 337.318);
--chart-3: oklch(0.831 0.015 337.634);
--chart-4: oklch(0.899 0.002 337.307);
--chart-5: oklch(0.973 0.01 337.478);
}
.dark {
--radius: 0.5rem;
--background: oklch(0.086 0.015 337.603);
--foreground: oklch(0.992 0.001 337.279);
--muted: oklch(0.174 0.03 340.503);
--muted-foreground: oklch(0.72 0.011 337.56);
--popover: oklch(0.108 0.019 337.603);
--popover-foreground: oklch(1 0 180);
--card: oklch(0.108 0.019 337.603);
--card-foreground: oklch(1 0 180);
--border: oklch(0.278 0.03 256.848);
--input: oklch(0.278 0.03 256.848);
--primary: oklch(0.973 0.01 337.465);
--primary-foreground: oklch(0.463 0.136 342.918);
--secondary: oklch(0.222 0.012 338.348);
--secondary-foreground: oklch(0.764 0.024 337.883);
--accent: oklch(0.31 0.039 339.667);
--accent-foreground: oklch(0.834 0.031 337.992);
--destructive: oklch(0.692 0.174 44.266);
--destructive-foreground: oklch(0 0 0);
--ring: oklch(0.973 0.01 337.465);
--chart-1: oklch(0.973 0.01 337.465);
--chart-2: oklch(0.222 0.012 338.348);
--chart-3: oklch(0.31 0.039 339.667);
--chart-4: oklch(0.254 0.015 338.43);
--chart-5: oklch(0.973 0.01 337.478);
}