Constant is a shadcn/ui theme built around a deep green primary color (#343c20) with deep violet accents (#28203c). The light mode uses a neutral background (#fbfdf7). Dark mode keeps the deep green primary (#343c20) on a neutral background (#060803).
| Token | Light | Dark |
|---|---|---|
| Background | #fbfdf7snow | #060803black |
| Foreground | #070902black | #fdfdfcwhite |
| Card | #f9fbf3floralwhite | #090b04black |
| Card foreground | #030401black | #ffffffwhite |
| Popover | #fbfdf7snow | #060803black |
| Popover foreground | #070902black | #fdfdfcwhite |
| Primary | #343c20darkslategray | #343c20darkslategray |
| Primary foreground | #ced8b6silver | #ced8b6silver |
| Secondary | #28203cdarkslategray | #28203cdarkslategray |
| Secondary foreground | #c0b6d8lightsteelblue | #c0b6d8lightsteelblue |
| Muted | #d3cce5thistle | #211a33midnightblue |
| Muted foreground | #3e394cdarkslategray | #b9b3c6silver |
| Accent | #28203cdarkslategray | #28203cdarkslategray |
| Accent foreground | #c0b6d8lightsteelblue | #c0b6d8lightsteelblue |
| Destructive | #781802maroon | #e12d05orangered |
| Destructive foreground | #fdbdaflightpink | #ffffffwhite |
| Border | #e5e7eblavender | #1f2937darkslategray |
| Input | #e5e7eblavender | #1f2937darkslategray |
| Ring | #343c20darkslategray | #343c20darkslategray |
WCAG 2 contrast ratios between each background and its foreground color.
| Text on background | 19.49:1 | AAA |
| Text on card | 19.75:1 | AAA |
| Primary button | 7.82:1 | AAA |
| Secondary button | 8.01:1 | AAA |
| Muted text | 7.15:1 | AAA |
| Accent | 8.01:1 | AAA |
| Destructive | 6.77:1 | AA |
| Text on background | 19.79:1 | AAA |
| Text on card | 19.74:1 | AAA |
| Primary button | 7.82:1 | AAA |
| Secondary button | 8.01:1 | AAA |
| Muted text | 8.22:1 | AAA |
| Accent | 8.01:1 | AAA |
| Destructive | 4.58:1 | AA |
Paste this into your globals.css to use Constant in your shadcn/ui project.
:root {
--radius: 0.5rem;
--background: oklch(0.99 0.007 119.43);
--foreground: oklch(0.131 0.023 119.273);
--muted: oklch(0.859 0.035 298.595);
--muted-foreground: oklch(0.358 0.032 297.725);
--popover: oklch(0.99 0.007 119.43);
--popover-foreground: oklch(0.131 0.023 119.273);
--card: oklch(0.985 0.011 119.495);
--card-foreground: oklch(0.104 0.018 119.273);
--border: oklch(0.928 0.006 264.531);
--input: oklch(0.928 0.006 264.531);
--primary: oklch(0.34 0.046 121.783);
--primary-foreground: oklch(0.865 0.046 120.232);
--secondary: oklch(0.267 0.051 295.802);
--secondary-foreground: oklch(0.795 0.048 298.258);
--accent: oklch(0.267 0.051 295.802);
--accent-foreground: oklch(0.795 0.048 298.258);
--destructive: oklch(0.375 0.134 33.538);
--destructive-foreground: oklch(0.854 0.077 32.968);
--ring: oklch(0.34 0.046 121.783);
--chart-1: oklch(0.34 0.046 121.783);
--chart-2: oklch(0.267 0.051 295.802);
--chart-3: oklch(0.267 0.051 295.802);
--chart-4: oklch(0.293 0.058 295.651);
--chart-5: oklch(0.344 0.05 122.002);
}
.dark {
--radius: 0.5rem;
--background: oklch(0.127 0.017 119.28);
--foreground: oklch(0.994 0.002 119.332);
--muted: oklch(0.238 0.048 295.58);
--muted-foreground: oklch(0.778 0.027 298.715);
--popover: oklch(0.127 0.017 119.28);
--popover-foreground: oklch(0.994 0.002 119.332);
--card: oklch(0.146 0.019 119.492);
--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.34 0.046 121.783);
--primary-foreground: oklch(0.865 0.046 120.232);
--secondary: oklch(0.267 0.051 295.802);
--secondary-foreground: oklch(0.795 0.048 298.258);
--accent: oklch(0.267 0.051 295.802);
--accent-foreground: oklch(0.795 0.048 298.258);
--destructive: oklch(0.589 0.218 32.464);
--destructive-foreground: oklch(1 0 180);
--ring: oklch(0.34 0.046 121.783);
--chart-1: oklch(0.34 0.046 121.783);
--chart-2: oklch(0.267 0.051 295.802);
--chart-3: oklch(0.267 0.051 295.802);
--chart-4: oklch(0.293 0.058 295.651);
--chart-5: oklch(0.344 0.05 122.002);
}