Useful is a shadcn/ui theme built around a violet primary color (#8f48e5) with neutral gray accents (#dbdadd). The light mode uses a neutral background (#fcfbfe). Dark mode keeps the violet primary (#8f48e5) on a violet-tinted background (#0a070d).
| Token | Light | Dark |
|---|---|---|
| Background | #fcfbfewhite | #0a070dblack |
| Foreground | #020104black | #f7f7f8whitesmoke |
| Card | #fcfbfewhite | #0a070dblack |
| Card foreground | #020104black | #f7f7f8whitesmoke |
| Popover | #fcfbfewhite | #0a070dblack |
| Popover foreground | #020104black | #f7f7f8whitesmoke |
| Primary | #8f48e5blueviolet | #8f48e5blueviolet |
| Primary foreground | #ffffffwhite | #ffffffwhite |
| Secondary | #dbdaddgainsboro | #19191ablack |
| Secondary foreground | #423f46darkslategray | #b2b2b3darkgray |
| Muted | #dacdeagainsboro | #221532midnightblue |
| Muted foreground | #564d60dimgray | #a79fb2darkgray |
| Accent | #dbdaddgainsboro | #19191ablack |
| Accent foreground | #423f46darkslategray | #b2b2b3darkgray |
| Destructive | #873408saddlebrown | #f26418chocolate |
| Destructive foreground | #fcd8c5bisque | #000000black |
| Border | #e5e7eblavender | #1f2937darkslategray |
| Input | #e5e7eblavender | #1f2937darkslategray |
| Ring | #8f48e5blueviolet | #8f48e5blueviolet |
WCAG 2 contrast ratios between each background and its foreground color.
| Text on background | 20.24:1 | AAA |
| Text on card | 20.24:1 | AAA |
| Primary button | 4.97:1 | AA |
| Secondary button | 7.40:1 | AAA |
| Muted text | 5.29:1 | AA |
| Accent | 7.40:1 | AAA |
| Destructive | 6.23:1 | AA |
| Text on background | 18.68:1 | AAA |
| Text on card | 18.68:1 | AAA |
| Primary button | 4.97:1 | AA |
| Secondary button | 8.27:1 | AAA |
| Muted text | 6.72:1 | AA |
| Accent | 8.27:1 | AAA |
| Destructive | 6.59:1 | AA |
Paste this into your globals.css to use Useful in your shadcn/ui project.
:root {
--radius: 0.5rem;
--background: oklch(0.991 0.003 306.389);
--foreground: oklch(0.079 0.019 307.942);
--muted: oklch(0.868 0.041 305.822);
--muted-foreground: oklch(0.436 0.033 305.471);
--popover: oklch(0.991 0.003 306.389);
--popover-foreground: oklch(0.079 0.019 307.942);
--card: oklch(0.991 0.003 306.389);
--card-foreground: oklch(0.079 0.019 307.942);
--border: oklch(0.928 0.006 264.531);
--input: oklch(0.928 0.006 264.531);
--primary: oklch(0.57 0.225 299.828);
--primary-foreground: oklch(1 0 180);
--secondary: oklch(0.889 0.005 306.355);
--secondary-foreground: oklch(0.373 0.012 306.024);
--accent: oklch(0.889 0.005 306.355);
--accent-foreground: oklch(0.373 0.012 306.024);
--destructive: oklch(0.437 0.124 43.05);
--destructive-foreground: oklch(0.908 0.047 50.036);
--ring: oklch(0.57 0.225 299.828);
--chart-1: oklch(0.57 0.225 299.828);
--chart-2: oklch(0.889 0.005 306.355);
--chart-3: oklch(0.889 0.005 306.355);
--chart-4: oklch(0.913 0.004 306.372);
--chart-5: oklch(0.569 0.232 299.443);
}
.dark {
--radius: 0.5rem;
--background: oklch(0.137 0.015 306.147);
--foreground: oklch(0.976 0.002 306.397);
--muted: oklch(0.23 0.055 303.079);
--muted-foreground: oklch(0.715 0.029 305.912);
--popover: oklch(0.137 0.015 306.147);
--popover-foreground: oklch(0.976 0.002 306.397);
--card: oklch(0.137 0.015 306.147);
--card-foreground: oklch(0.976 0.002 306.397);
--border: oklch(0.278 0.03 256.848);
--input: oklch(0.278 0.03 256.848);
--primary: oklch(0.57 0.225 299.828);
--primary-foreground: oklch(1 0 180);
--secondary: oklch(0.215 0.001 306.366);
--secondary-foreground: oklch(0.764 0.002 306.39);
--accent: oklch(0.215 0.001 306.366);
--accent-foreground: oklch(0.764 0.002 306.39);
--destructive: oklch(0.673 0.191 43.041);
--destructive-foreground: oklch(0 0 0);
--ring: oklch(0.57 0.225 299.828);
--chart-1: oklch(0.57 0.225 299.828);
--chart-2: oklch(0.215 0.001 306.366);
--chart-3: oklch(0.215 0.001 306.366);
--chart-4: oklch(0.248 0.001 306.361);
--chart-5: oklch(0.569 0.232 299.443);
}