Constant is a shadcn/ui theme built around a light purple primary color (#e7b0e8) with neutral gray accents (#d3cfd3). The light mode uses a neutral background (#fcf8fc). Dark mode keeps the light purple primary (#e7b0e8) on a neutral background (#000000).
| Token | Light | Dark |
|---|---|---|
| Background | #fcf8fcsnow | #000000black |
| Foreground | #000000black | #fcf8fcsnow |
| Card | #fcf8fcsnow | #000000black |
| Card foreground | #000000black | #fcf8fcsnow |
| Popover | #fcf8fcsnow | #000000black |
| Popover foreground | #000000black | #fcf8fcsnow |
| Primary | #e7b0e8plum | #e7b0e8plum |
| Primary foreground | #4e174findigo | #4e174findigo |
| Secondary | #d3cfd3lightgrey | #322532darkslategray |
| Secondary foreground | #3a363adarkslategray | #cdbccdthistle |
| Muted | #f4e6f4lavenderblush | #180b19black |
| Muted foreground | #525252darkslategray | #adadaddarkgray |
| Accent | #d3cfd3lightgrey | #322532darkslategray |
| Accent foreground | #3a363adarkslategray | #cdbccdthistle |
| Destructive | #bc1610firebrick | #e11a14crimson |
| Destructive foreground | #ffffffwhite | #ffffffwhite |
| Border | #e5e7eblavender | #1f2937darkslategray |
| Input | #e5e7eblavender | #1f2937darkslategray |
| Ring | #e7b0e8plum | #e7b0e8plum |
WCAG 2 contrast ratios between each background and its foreground color.
| Text on background | 19.94:1 | AAA |
| Text on card | 19.94:1 | AAA |
| Primary button | 7.56:1 | AAA |
| Secondary button | 7.72:1 | AAA |
| Muted text | 6.51:1 | AA |
| Accent | 7.72:1 | AAA |
| Destructive | 6.45:1 | AA |
| Text on background | 19.97:1 | AAA |
| Text on card | 19.97:1 | AAA |
| Primary button | 7.56:1 | AAA |
| Secondary button | 8.09:1 | AAA |
| Muted text | 8.49:1 | AAA |
| Accent | 8.09:1 | AAA |
| Destructive | 4.80:1 | AA |
Paste this into your globals.css to use Constant in your shadcn/ui project.
:root {
--radius: 0.5rem;
--background: oklch(0.983 0.007 325.15);
--foreground: oklch(0 0 0);
--muted: oklch(0.941 0.023 325.269);
--muted-foreground: oklch(0.437 0 180);
--popover: oklch(0.983 0.007 325.15);
--popover-foreground: oklch(0 0 0);
--card: oklch(0.983 0.007 325.15);
--card-foreground: oklch(0 0 0);
--border: oklch(0.928 0.006 264.531);
--input: oklch(0.928 0.006 264.531);
--primary: oklch(0.825 0.096 325.864);
--primary-foreground: oklch(0.318 0.11 327.11);
--secondary: oklch(0.859 0.006 325.152);
--secondary-foreground: oklch(0.339 0.01 325.3);
--accent: oklch(0.859 0.006 325.152);
--accent-foreground: oklch(0.339 0.01 325.3);
--destructive: oklch(0.507 0.197 28.969);
--destructive-foreground: oklch(1 0 180);
--ring: oklch(0.825 0.096 325.864);
--chart-1: oklch(0.825 0.096 325.864);
--chart-2: oklch(0.859 0.006 325.152);
--chart-3: oklch(0.859 0.006 325.152);
--chart-4: oklch(0.883 0.005 325.142);
--chart-5: oklch(0.825 0.101 325.903);
}
.dark {
--radius: 0.5rem;
--background: oklch(0 0 0);
--foreground: oklch(0.983 0.007 325.149);
--muted: oklch(0.176 0.034 326.324);
--muted-foreground: oklch(0.749 0 158.199);
--popover: oklch(0 0 0);
--popover-foreground: oklch(0.983 0.007 325.149);
--card: oklch(0 0 0);
--card-foreground: oklch(0.983 0.007 325.149);
--border: oklch(0.278 0.03 256.848);
--input: oklch(0.278 0.03 256.848);
--primary: oklch(0.825 0.096 325.864);
--primary-foreground: oklch(0.318 0.11 327.11);
--secondary: oklch(0.284 0.03 325.789);
--secondary-foreground: oklch(0.814 0.031 325.36);
--accent: oklch(0.284 0.03 325.789);
--accent-foreground: oklch(0.814 0.031 325.36);
--destructive: oklch(0.58 0.227 29.045);
--destructive-foreground: oklch(1 0 180);
--ring: oklch(0.825 0.096 325.864);
--chart-1: oklch(0.825 0.096 325.864);
--chart-2: oklch(0.284 0.03 325.789);
--chart-3: oklch(0.284 0.03 325.789);
--chart-4: oklch(0.314 0.034 325.814);
--chart-5: oklch(0.825 0.101 325.903);
}