Modern Purple Theme Dark is a shadcn/ui theme built around a near-white primary color (#ffffff) with deep violet accents (#3d315e). The light mode uses a violet-tinted background (#1d172c). Dark mode keeps the near-white primary (#ffffff) on a violet-tinted background (#1d172c).
| Token | Light | Dark |
|---|---|---|
| Background | #1d172cblack | #1d172cblack |
| Foreground | #9998ecmediumpurple | #9998ecmediumpurple |
| Card | #181325black | #181325black |
| Card foreground | #aeadf0lightsteelblue | #aeadf0lightsteelblue |
| Popover | #161122black | #161122black |
| Popover foreground | #c3c3f4lightsteelblue | #c3c3f4lightsteelblue |
| Primary | #ffffffwhite | #ffffffwhite |
| Primary foreground | #333333darkslategray | #333333darkslategray |
| Secondary | #404040darkslategray | #404040darkslategray |
| Secondary foreground | #d9d9d9gainsboro | #d9d9d9gainsboro |
| Muted | #292631darkslategray | #292631darkslategray |
| Muted foreground | #a6a1b5darkgray | #a6a1b5darkgray |
| Accent | #3d315edarkslategray | #3d315edarkslategray |
| Accent foreground | #dcd7eagainsboro | #dcd7eagainsboro |
| Destructive | #e22e12orangered | #e22e12orangered |
| Destructive foreground | #ffffffwhite | #ffffffwhite |
| Border | #2a2438darkslategray | #2a2438darkslategray |
| Input | #302a41darkslategray | #302a41darkslategray |
| Ring | #ffffffwhite | #ffffffwhite |
WCAG 2 contrast ratios between each background and its foreground color.
| Text on background | 6.68:1 | AA |
| Text on card | 8.65:1 | AAA |
| Primary button | 12.63:1 | AAA |
| Secondary button | 7.37:1 | AAA |
| Muted text | 5.91:1 | AA |
| Accent | 8.32:1 | AAA |
| Destructive | 4.51:1 | AA |
| Text on background | 6.68:1 | AA |
| Text on card | 8.65:1 | AAA |
| Primary button | 12.63:1 | AAA |
| Secondary button | 7.37:1 | AAA |
| Muted text | 5.91:1 | AA |
| Accent | 8.32:1 | AAA |
| Destructive | 4.51:1 | AA |
Paste this into your globals.css to use Modern Purple Theme Dark in your shadcn/ui project.
:root {
--radius: 0.5rem;
--background: oklch(0.221 0.041 295.893);
--foreground: oklch(0.713 0.122 283.623);
--muted: oklch(0.277 0.019 298.092);
--muted-foreground: oklch(0.719 0.03 298.596);
--popover: oklch(0.194 0.033 296.23);
--popover-foreground: oklch(0.833 0.069 285.574);
--card: oklch(0.203 0.036 296.105);
--card-foreground: oklch(0.773 0.095 284.717);
--border: oklch(0.275 0.037 296.885);
--input: oklch(0.302 0.043 296.788);
--primary: oklch(1 0 180);
--primary-foreground: oklch(0.321 0 180);
--secondary: oklch(0.371 0 168.69);
--secondary-foreground: oklch(0.885 0 180);
--accent: oklch(0.348 0.078 295.068);
--accent-foreground: oklch(0.888 0.027 298.778);
--destructive: oklch(0.593 0.218 31.459);
--destructive-foreground: oklch(1 0 180);
--ring: oklch(1 0 180);
--chart-1: oklch(1 0 180);
--chart-2: oklch(0.371 0 168.69);
--chart-3: oklch(0.348 0.078 295.068);
--chart-4: oklch(0.399 0 180);
--chart-5: oklch(1 0 180);
}
.dark {
--radius: 0.5rem;
--background: oklch(0.221 0.041 295.893);
--foreground: oklch(0.713 0.122 283.623);
--muted: oklch(0.277 0.019 298.092);
--muted-foreground: oklch(0.719 0.03 298.596);
--popover: oklch(0.194 0.033 296.23);
--popover-foreground: oklch(0.833 0.069 285.574);
--card: oklch(0.203 0.036 296.105);
--card-foreground: oklch(0.773 0.095 284.717);
--border: oklch(0.275 0.037 296.885);
--input: oklch(0.302 0.043 296.788);
--primary: oklch(1 0 180);
--primary-foreground: oklch(0.321 0 180);
--secondary: oklch(0.371 0 168.69);
--secondary-foreground: oklch(0.885 0 180);
--accent: oklch(0.348 0.078 295.068);
--accent-foreground: oklch(0.888 0.027 298.778);
--destructive: oklch(0.593 0.218 31.459);
--destructive-foreground: oklch(1 0 180);
--ring: oklch(1 0 180);
--chart-1: oklch(1 0 180);
--chart-2: oklch(0.371 0 168.69);
--chart-3: oklch(0.348 0.078 295.068);
--chart-4: oklch(0.399 0 180);
--chart-5: oklch(1 0 180);
}