Snack for shadcn/ui

Snack is a shadcn/ui theme built around a muted teal primary color (#3e5b58) with neutral gray accents (#e6e6e6). The light mode uses a neutral background (#ffffff). Dark mode keeps the muted teal primary (#3e5b58) on a teal-tinted background (#040c0b).

Color palette

TokenLightDark
Background
#ffffffwhite
#040c0bblack
Foreground
#010908black
#f5faf9mintcream
Card
#fcfcfcsnow
#05100eblack
Card foreground
#010404black
#f8fcfbmintcream
Popover
#fcfcfcsnow
#05100eblack
Popover foreground
#010404black
#f8fcfbmintcream
Primary
#3e5b58darkslategray
#3e5b58darkslategray
Primary foreground
#e1eae9lavender
#e1eae9lavender
Secondary
#e6e6e6gainsboro
#151918black
Secondary foreground
#4d4d4ddarkslategray
#aab6b5darkgray
Muted
#efdcdcmistyrose
#102321black
Muted foreground
#4a3a3adarkslategray
#b5c5c3silver
Accent
#e6e6e6gainsboro
#151918black
Accent foreground
#4d4d4ddarkslategray
#aab6b5darkgray
Destructive
#c03e02firebrick
#fd6621tomato
Destructive foreground
#ffffffwhite
#000000black
Border
#e5e7eblavender
#1f2937darkslategray
Input
#e5e7eblavender
#1f2937darkslategray
Ring
#3e5b58darkslategray
#3e5b58darkslategray

Contrast

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

Light mode
Text on background20.11:1AAA
Text on card20.13:1AAA
Primary button6.03:1AA
Secondary button6.74:1AA
Muted text8.13:1AAA
Accent6.74:1AA
Destructive5.34:1AA
Dark mode
Text on background18.79:1AAA
Text on card18.73:1AAA
Primary button6.03:1AA
Secondary button8.51:1AAA
Muted text9.12:1AAA
Accent8.51:1AAA
Destructive7.10:1AAA

CSS variables

Paste this into your globals.css to use Snack in your shadcn/ui project.

:root {
  --radius: 0.5rem;
  --background: oklch(1 0 180);
  --foreground: oklch(0.128 0.018 189.147);
  --muted: oklch(0.91 0.021 17.553);
  --muted-foreground: oklch(0.367 0.023 18.229);
  --popover: oklch(0.992 0 161.565);
  --popover-foreground: oklch(0.101 0.014 189.147);
  --card: oklch(0.992 0 161.565);
  --card-foreground: oklch(0.101 0.014 189.147);
  --border: oklch(0.928 0.006 264.531);
  --input: oklch(0.928 0.006 264.531);
  --primary: oklch(0.447 0.035 188.203);
  --primary-foreground: oklch(0.931 0.01 189.821);
  --secondary: oklch(0.923 0 153.435);
  --secondary-foreground: oklch(0.418 0 173.29);
  --accent: oklch(0.923 0 153.435);
  --accent-foreground: oklch(0.418 0 173.29);
  --destructive: oklch(0.546 0.175 38.707);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.447 0.035 188.203);
  --chart-1: oklch(0.447 0.035 188.203);
  --chart-2: oklch(0.923 0 153.435);
  --chart-3: oklch(0.923 0 153.435);
  --chart-4: oklch(0.947 0 180);
  --chart-5: oklch(0.453 0.04 187.942);
}

.dark {
  --radius: 0.5rem;
  --background: oklch(0.143 0.015 188.972);
  --foreground: oklch(0.981 0.006 189.944);
  --muted: oklch(0.24 0.026 187.357);
  --muted-foreground: oklch(0.81 0.018 189.579);
  --popover: oklch(0.159 0.017 188.09);
  --popover-foreground: oklch(0.987 0.004 189.989);
  --card: oklch(0.159 0.017 188.09);
  --card-foreground: oklch(0.987 0.004 189.989);
  --border: oklch(0.278 0.03 256.848);
  --input: oklch(0.278 0.03 256.848);
  --primary: oklch(0.447 0.035 188.203);
  --primary-foreground: oklch(0.931 0.01 189.821);
  --secondary: oklch(0.208 0.006 189.451);
  --secondary-foreground: oklch(0.767 0.014 189.653);
  --accent: oklch(0.208 0.006 189.451);
  --accent-foreground: oklch(0.767 0.014 189.653);
  --destructive: oklch(0.694 0.198 41.357);
  --destructive-foreground: oklch(0 0 0);
  --ring: oklch(0.447 0.035 188.203);
  --chart-1: oklch(0.447 0.035 188.203);
  --chart-2: oklch(0.208 0.006 189.451);
  --chart-3: oklch(0.208 0.006 189.451);
  --chart-4: oklch(0.243 0.007 189.389);
  --chart-5: oklch(0.453 0.04 187.942);
}