Nanoparticle is a shadcn/ui theme built around a muted violet primary color (#634974) with muted light violet accents (#d2cdd5). The light mode uses a neutral background (#faf8fc). Dark mode keeps the muted violet primary (#634974) on a neutral background (#030203).
| Token | Light | Dark |
|---|---|---|
| Background | #faf8fcghostwhite | #030203black |
| Foreground | #000000black | #ffffffwhite |
| Card | #f8f5fawhitesmoke | #050307black |
| Card foreground | #000000black | #ffffffwhite |
| Popover | #f8f5fawhitesmoke | #050307black |
| Popover foreground | #000000black | #ffffffwhite |
| Primary | #634974dimgray | #634974dimgray |
| Primary foreground | #f8f6f9whitesmoke | #f8f6f9whitesmoke |
| Secondary | #ebeaeblavender | #221e24black |
| Secondary foreground | #525152darkslategray | #bcb4c0silver |
| Muted | #e9e4eclavender | #18131bblack |
| Muted foreground | #534b58darkslategray | #afa7b4darkgray |
| Accent | #d2cdd5lightgrey | #3a2f42darkslategray |
| Accent foreground | #39343ddarkslategray | #d3c9d9thistle |
| Destructive | #c84609chocolate | #f6773ccoral |
| Destructive foreground | #ffffffwhite | #000000black |
| Border | #e5e7eblavender | #1f2937darkslategray |
| Input | #e5e7eblavender | #1f2937darkslategray |
| Ring | #634974dimgray | #634974dimgray |
WCAG 2 contrast ratios between each background and its foreground color.
| Text on background | 19.92:1 | AAA |
| Text on card | 19.40:1 | AAA |
| Primary button | 7.15:1 | AAA |
| Secondary button | 6.59:1 | AA |
| Muted text | 6.66:1 | AA |
| Accent | 7.77:1 | AAA |
| Destructive | 4.86:1 | AA |
| Text on background | 20.73:1 | AAA |
| Text on card | 20.48:1 | AAA |
| Primary button | 7.15:1 | AAA |
| Secondary button | 8.14:1 | AAA |
| Muted text | 7.85:1 | AAA |
| Accent | 7.91:1 | AAA |
| Destructive | 7.61:1 | AAA |
Paste this into your globals.css to use Nanoparticle in your shadcn/ui project.
:root {
--radius: 0.5rem;
--background: oklch(0.982 0.005 312.951);
--foreground: oklch(0 0 0);
--muted: oklch(0.925 0.012 312.895);
--muted-foreground: oklch(0.426 0.024 312.61);
--popover: oklch(0.973 0.007 312.933);
--popover-foreground: oklch(0 0 0);
--card: oklch(0.973 0.007 312.933);
--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.45 0.076 311.802);
--primary-foreground: oklch(0.975 0.005 312.949);
--secondary: oklch(0.939 0.001 312.981);
--secondary-foreground: oklch(0.436 0.003 312.939);
--accent: oklch(0.855 0.011 312.896);
--accent-foreground: oklch(0.333 0.017 312.634);
--destructive: oklch(0.568 0.176 39.548);
--destructive-foreground: oklch(1 0 180);
--ring: oklch(0.45 0.076 311.802);
--chart-1: oklch(0.45 0.076 311.802);
--chart-2: oklch(0.939 0.001 312.981);
--chart-3: oklch(0.855 0.011 312.896);
--chart-4: oklch(0.962 0 312.983);
--chart-5: oklch(0.447 0.085 311.622);
}
.dark {
--radius: 0.5rem;
--background: oklch(0.087 0.01 313.988);
--foreground: oklch(1 0 180);
--muted: oklch(0.196 0.018 312.36);
--muted-foreground: oklch(0.739 0.021 312.796);
--popover: oklch(0.109 0.013 313.988);
--popover-foreground: oklch(1 0 180);
--card: oklch(0.109 0.013 313.988);
--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.45 0.076 311.802);
--primary-foreground: oklch(0.975 0.005 312.949);
--secondary: oklch(0.242 0.012 312.639);
--secondary-foreground: oklch(0.78 0.019 312.817);
--accent: oklch(0.324 0.037 312.214);
--accent-foreground: oklch(0.849 0.024 312.795);
--destructive: oklch(0.708 0.171 43.471);
--destructive-foreground: oklch(0 0 0);
--ring: oklch(0.45 0.076 311.802);
--chart-1: oklch(0.45 0.076 311.802);
--chart-2: oklch(0.242 0.012 312.639);
--chart-3: oklch(0.324 0.037 312.214);
--chart-4: oklch(0.273 0.015 312.618);
--chart-5: oklch(0.447 0.085 311.622);
}