Foam for shadcn/ui

Foam is a shadcn/ui theme built around a deep blue primary color (#050915) with deep yellow accents (#151105). The light mode uses a neutral background (#ffffff). Dark mode keeps the deep blue primary (#050915) on a neutral background (#000000).

Color palette

TokenLightDark
Background
#ffffffwhite
#000000black
Foreground
#010204black
#f7f7f8whitesmoke
Card
#ffffffwhite
#000000black
Card foreground
#010204black
#f7f7f8whitesmoke
Popover
#ffffffwhite
#000000black
Popover foreground
#010204black
#f7f7f8whitesmoke
Primary
#050915black
#050915black
Primary foreground
#6e8addcornflowerblue
#6e8addcornflowerblue
Secondary
#151105black
#151105black
Secondary foreground
#ba962cperu
#ba962cperu
Muted
#e5dfccgainsboro
#332d1adarkslategray
Muted foreground
#655f4edimgray
#b1ac9adarkgray
Accent
#151105black
#151105black
Accent foreground
#ba962cperu
#ba962cperu
Destructive
#700a01maroon
#e91501red
Destructive foreground
#ffaba4lightpink
#ffffffwhite
Border
#e5e7eblavender
#1f2937darkslategray
Input
#e5e7eblavender
#1f2937darkslategray
Ring
#050915black
#050915black

Contrast

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

Light mode
Text on background20.75:1AAA
Text on card20.75:1AAA
Primary button6.01:1AA
Secondary button6.73:1AA
Muted text4.78:1AA
Accent6.73:1AA
Destructive6.72:1AA
Dark mode
Text on background19.61:1AAA
Text on card19.61:1AAA
Primary button6.01:1AA
Secondary button6.73:1AA
Muted text6.06:1AA
Accent6.73:1AA
Destructive4.58:1AA

CSS variables

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

:root {
  --radius: 0.5rem;
  --background: oklch(1 0 180);
  --foreground: oklch(0.08 0.015 261.765);
  --muted: oklch(0.904 0.026 91.637);
  --muted-foreground: oklch(0.486 0.028 91.778);
  --popover: oklch(1 0 180);
  --popover-foreground: oklch(0.08 0.015 261.765);
  --card: oklch(1 0 180);
  --card-foreground: oklch(0.08 0.015 261.765);
  --border: oklch(0.928 0.006 264.531);
  --input: oklch(0.928 0.006 264.531);
  --primary: oklch(0.141 0.027 265.709);
  --primary-foreground: oklch(0.649 0.128 268.712);
  --secondary: oklch(0.177 0.024 92.822);
  --secondary-foreground: oklch(0.689 0.126 89.412);
  --accent: oklch(0.177 0.024 92.822);
  --accent-foreground: oklch(0.689 0.126 89.412);
  --destructive: oklch(0.347 0.135 30.917);
  --destructive-foreground: oklch(0.821 0.099 25.174);
  --ring: oklch(0.141 0.027 265.709);
  --chart-1: oklch(0.141 0.027 265.709);
  --chart-2: oklch(0.177 0.024 92.822);
  --chart-3: oklch(0.177 0.024 92.822);
  --chart-4: oklch(0.223 0.033 91.259);
  --chart-5: oklch(0.14 0.029 265.193);
}

.dark {
  --radius: 0.5rem;
  --background: oklch(0 0 0);
  --foreground: oklch(0.976 0.002 271.394);
  --muted: oklch(0.297 0.033 91.711);
  --muted-foreground: oklch(0.743 0.025 91.668);
  --popover: oklch(0 0 0);
  --popover-foreground: oklch(0.976 0.002 271.394);
  --card: oklch(0 0 0);
  --card-foreground: oklch(0.976 0.002 271.394);
  --border: oklch(0.278 0.03 256.848);
  --input: oklch(0.278 0.03 256.848);
  --primary: oklch(0.141 0.027 265.709);
  --primary-foreground: oklch(0.649 0.128 268.712);
  --secondary: oklch(0.177 0.024 92.822);
  --secondary-foreground: oklch(0.689 0.126 89.412);
  --accent: oklch(0.177 0.024 92.822);
  --accent-foreground: oklch(0.689 0.126 89.412);
  --destructive: oklch(0.592 0.237 30.048);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.141 0.027 265.709);
  --chart-1: oklch(0.141 0.027 265.709);
  --chart-2: oklch(0.177 0.024 92.822);
  --chart-3: oklch(0.177 0.024 92.822);
  --chart-4: oklch(0.223 0.033 91.259);
  --chart-5: oklch(0.14 0.029 265.193);
}