Cand-2 for shadcn/ui

Cand-2 is a shadcn/ui theme built around a violet primary color (#774da8) with green accents (#4da877). The light mode uses a neutral background (#faf8fc). Dark mode keeps the violet primary (#774da8) on a neutral background (#050208).

Color palette

TokenLightDark
Background
#faf8fcghostwhite
#050208black
Foreground
#07040cblack
#faf8fbghostwhite
Card
#f7f5fawhitesmoke
#07030cblack
Card foreground
#050208black
#fcfcfdwhite
Popover
#f7f5fawhitesmoke
#07030cblack
Popover foreground
#050208black
#fcfcfdwhite
Primary
#774da8rebeccapurple
#774da8rebeccapurple
Primary foreground
#ffffffwhite
#ffffffwhite
Secondary
#a8774dperu
#a8774dperu
Secondary foreground
#000000black
#000000black
Muted
#e6d8ccgainsboro
#332519black
Muted foreground
#524f4cdarkslategray
#b3b0addarkgray
Accent
#4da877mediumseagreen
#4da877mediumseagreen
Accent foreground
#0d1c14black
#0d1c14black
Destructive
#bb2a02firebrick
#e33302orangered
Destructive foreground
#ffffffwhite
#ffffffwhite
Border
#e5e7eblavender
#1f2937darkslategray
Input
#e5e7eblavender
#1f2937darkslategray
Ring
#774da8rebeccapurple
#774da8rebeccapurple

Contrast

WCAG 2 contrast ratios between each background and its foreground color.

Light mode
Text on background19.28:1AAA
Text on card19.00:1AAA
Primary button6.14:1AA
Secondary button5.42:1AA
Muted text5.82:1AA
Accent6.00:1AA
Destructive6.10:1AA
Dark mode
Text on background19.51:1AAA
Text on card19.91:1AAA
Primary button6.14:1AA
Secondary button5.42:1AA
Muted text6.82:1AA
Accent6.00:1AA
Destructive4.42:1AA Large

CSS variables

Paste this into your globals.css to use Cand-2 in your shadcn/ui project.

:root {
  --radius: 0.5rem;
  --background: oklch(0.982 0.005 307.049);
  --foreground: oklch(0.118 0.023 308.237);
  --muted: oklch(0.89 0.022 63.762);
  --muted-foreground: oklch(0.429 0.007 63.894);
  --popover: oklch(0.973 0.008 307.017);
  --popover-foreground: oklch(0.103 0.02 308.423);
  --card: oklch(0.973 0.008 307.017);
  --card-foreground: oklch(0.103 0.02 308.423);
  --border: oklch(0.928 0.006 264.531);
  --input: oklch(0.928 0.006 264.531);
  --primary: oklch(0.51 0.142 303.262);
  --primary-foreground: oklch(1 0 180);
  --secondary: oklch(0.61 0.084 61.441);
  --secondary-foreground: oklch(0 0 0);
  --accent: oklch(0.662 0.114 157.775);
  --accent-foreground: oklch(0.21 0.026 159.68);
  --destructive: oklch(0.517 0.186 33.823);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.51 0.142 303.262);
  --chart-1: oklch(0.51 0.142 303.262);
  --chart-2: oklch(0.61 0.084 61.441);
  --chart-3: oklch(0.662 0.114 157.775);
  --chart-4: oklch(0.636 0.085 61.572);
  --chart-5: oklch(0.506 0.153 302.85);
}

.dark {
  --radius: 0.5rem;
  --background: oklch(0.101 0.023 308.648);
  --foreground: oklch(0.982 0.004 307.06);
  --muted: oklch(0.279 0.03 62.332);
  --muted-foreground: oklch(0.758 0.006 63.994);
  --popover: oklch(0.115 0.027 308.349);
  --popover-foreground: oklch(0.991 0.002 307.086);
  --card: oklch(0.115 0.027 308.349);
  --card-foreground: oklch(0.991 0.002 307.086);
  --border: oklch(0.278 0.03 256.848);
  --input: oklch(0.278 0.03 256.848);
  --primary: oklch(0.51 0.142 303.262);
  --primary-foreground: oklch(1 0 180);
  --secondary: oklch(0.61 0.084 61.441);
  --secondary-foreground: oklch(0 0 0);
  --accent: oklch(0.662 0.114 157.775);
  --accent-foreground: oklch(0.21 0.026 159.68);
  --destructive: oklch(0.597 0.216 33.493);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.51 0.142 303.262);
  --chart-1: oklch(0.51 0.142 303.262);
  --chart-2: oklch(0.61 0.084 61.441);
  --chart-3: oklch(0.662 0.114 157.775);
  --chart-4: oklch(0.636 0.085 61.572);
  --chart-5: oklch(0.506 0.153 302.85);
}