Affect is a shadcn/ui theme built around a vivid purple primary color (#fe6cfe) with muted light purple accents (#dbd2db). The light mode uses a neutral background (#fdf7fd). Dark mode keeps the vivid purple primary (#fe6cfe) on a purple-tinted background (#0c040c).
| Token | Light | Dark |
|---|---|---|
| Background | #fdf7fdsnow | #0c040cblack |
| Foreground | #040104black | #fdfcfdwhite |
| Card | #fdf7fdsnow | #0c040cblack |
| Card foreground | #040104black | #fdfcfdwhite |
| Popover | #fdf7fdsnow | #0c040cblack |
| Popover foreground | #040104black | #fdfcfdwhite |
| Primary | #fe6cfeviolet | #fe6cfeviolet |
| Primary foreground | #380038midnightblue | #380038midnightblue |
| Secondary | #e6e5e6gainsboro | #181118black |
| Secondary foreground | #4f4a4fdarkslategray | #bd9ebddarkgray |
| Muted | #f3ecf3whitesmoke | #130c13black |
| Muted foreground | #454545darkslategray | #bababasilver |
| Accent | #dbd2dbgainsboro | #311b31darkslategray |
| Accent foreground | #443644darkslategray | #d2add2thistle |
| Destructive | #8f130fdarkred | #e9352fcrimson |
| Destructive foreground | #fbd7d5mistyrose | #ffffffwhite |
| Border | #e5e7eblavender | #1f2937darkslategray |
| Input | #e5e7eblavender | #1f2937darkslategray |
| Ring | #fe6cfeviolet | #fe6cfeviolet |
WCAG 2 contrast ratios between each background and its foreground color.
| Text on background | 19.67:1 | AAA |
| Text on card | 19.67:1 | AAA |
| Primary button | 7.17:1 | AAA |
| Secondary button | 6.88:1 | AA |
| Muted text | 8.28:1 | AAA |
| Accent | 7.65:1 | AAA |
| Destructive | 6.94:1 | AA |
| Text on background | 19.80:1 | AAA |
| Text on card | 19.80:1 | AAA |
| Primary button | 7.17:1 | AAA |
| Secondary button | 7.77:1 | AAA |
| Muted text | 9.94:1 | AAA |
| Accent | 7.97:1 | AAA |
| Destructive | 4.17:1 | AA Large |
Paste this into your globals.css to use Affect in your shadcn/ui project.
:root {
--radius: 0.5rem;
--background: oklch(0.982 0.009 325.648);
--foreground: oklch(0.085 0.026 327.553);
--muted: oklch(0.951 0.011 325.666);
--muted-foreground: oklch(0.39 0 165.964);
--popover: oklch(0.982 0.009 325.648);
--popover-foreground: oklch(0.085 0.026 327.553);
--card: oklch(0.982 0.009 325.648);
--card-foreground: oklch(0.085 0.026 327.553);
--border: oklch(0.928 0.006 264.531);
--input: oklch(0.928 0.006 264.531);
--primary: oklch(0.762 0.242 327.632);
--primary-foreground: oklch(0.239 0.109 328.351);
--secondary: oklch(0.923 0.003 325.598);
--secondary-foreground: oklch(0.416 0.01 325.748);
--accent: oklch(0.873 0.016 325.71);
--accent-foreground: oklch(0.354 0.029 326.173);
--destructive: oklch(0.418 0.158 28.638);
--destructive-foreground: oklch(0.908 0.04 20.265);
--ring: oklch(0.762 0.242 327.632);
--chart-1: oklch(0.762 0.242 327.632);
--chart-2: oklch(0.923 0.003 325.598);
--chart-3: oklch(0.873 0.016 325.71);
--chart-4: oklch(0.946 0.002 325.591);
--chart-5: oklch(0.763 0.248 327.671);
}
.dark {
--radius: 0.5rem;
--background: oklch(0.125 0.027 327.034);
--foreground: oklch(0.992 0.001 325.586);
--muted: oklch(0.166 0.018 326.334);
--muted-foreground: oklch(0.789 0 171.254);
--popover: oklch(0.125 0.027 327.034);
--popover-foreground: oklch(0.992 0.001 325.586);
--card: oklch(0.125 0.027 327.034);
--card-foreground: oklch(0.992 0.001 325.586);
--border: oklch(0.278 0.03 256.848);
--input: oklch(0.278 0.03 256.848);
--primary: oklch(0.762 0.242 327.632);
--primary-foreground: oklch(0.239 0.109 328.351);
--secondary: oklch(0.189 0.02 326.32);
--secondary-foreground: oklch(0.736 0.056 326.129);
--accent: oklch(0.262 0.051 326.904);
--accent-foreground: oklch(0.791 0.066 326.176);
--destructive: oklch(0.612 0.216 27.811);
--destructive-foreground: oklch(1 0 180);
--ring: oklch(0.762 0.242 327.632);
--chart-1: oklch(0.762 0.242 327.632);
--chart-2: oklch(0.189 0.02 326.32);
--chart-3: oklch(0.262 0.051 326.904);
--chart-4: oklch(0.222 0.026 326.408);
--chart-5: oklch(0.763 0.248 327.671);
}