Calculator for shadcn/ui

Calculator is a shadcn/ui theme built around a near-black primary color (#1b1d1b) with near-black accents (#1d1b1d). The light mode uses a neutral background (#f8fcf7). Dark mode keeps the near-black primary (#1b1d1b) on a green-tinted background (#080d07).

Color palette

TokenLightDark
Background
#f8fcf7mintcream
#080d07black
Foreground
#030802black
#f7f8f6whitesmoke
Card
#f8fcf7mintcream
#080d07black
Card foreground
#030802black
#f7f8f6whitesmoke
Popover
#f8fcf7mintcream
#080d07black
Popover foreground
#030802black
#f7f8f6whitesmoke
Primary
#1b1d1bblack
#1b1d1bblack
Primary foreground
#b4b7b3silver
#b4b7b3silver
Secondary
#1d1b1dblack
#1d1b1dblack
Secondary foreground
#b7b3b7silver
#b7b3b7silver
Muted
#e9e0eblavender
#1d141fblack
Muted foreground
#686369dimgray
#9b969cdarkgray
Accent
#1d1b1dblack
#1d1b1dblack
Accent foreground
#b7b3b7silver
#b7b3b7silver
Destructive
#861b09darkred
#e62f0forangered
Destructive foreground
#fbcec5pink
#ffffffwhite
Border
#e5e7eblavender
#1f2937darkslategray
Input
#e5e7eblavender
#1f2937darkslategray
Ring
#1b1d1bblack
#1b1d1bblack

Contrast

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

Light mode
Text on background19.54:1AAA
Text on card19.54:1AAA
Primary button8.36:1AAA
Secondary button8.26:1AAA
Muted text4.57:1AA
Accent8.26:1AAA
Destructive6.75:1AA
Dark mode
Text on background18.37:1AAA
Text on card18.37:1AAA
Primary button8.36:1AAA
Secondary button8.26:1AAA
Muted text6.16:1AA
Accent8.26:1AAA
Destructive4.39:1AA Large

CSS variables

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

:root {
  --radius: 0.5rem;
  --background: oklch(0.988 0.008 140.519);
  --foreground: oklch(0.124 0.025 138.616);
  --muted: oklch(0.918 0.016 320.559);
  --muted-foreground: oklch(0.506 0.011 320.566);
  --popover: oklch(0.988 0.008 140.519);
  --popover-foreground: oklch(0.124 0.025 138.616);
  --card: oklch(0.988 0.008 140.519);
  --card-foreground: oklch(0.124 0.025 138.616);
  --border: oklch(0.928 0.006 264.531);
  --input: oklch(0.928 0.006 264.531);
  --primary: oklch(0.228 0.004 140.506);
  --primary-foreground: oklch(0.776 0.007 140.517);
  --secondary: oklch(0.225 0.004 320.558);
  --secondary-foreground: oklch(0.771 0.007 320.546);
  --accent: oklch(0.225 0.004 320.558);
  --accent-foreground: oklch(0.771 0.007 320.546);
  --destructive: oklch(0.406 0.145 32.142);
  --destructive-foreground: oklch(0.887 0.053 29.801);
  --ring: oklch(0.228 0.004 140.506);
  --chart-1: oklch(0.228 0.004 140.506);
  --chart-2: oklch(0.225 0.004 320.558);
  --chart-3: oklch(0.225 0.004 320.558);
  --chart-4: oklch(0.257 0.005 320.56);
  --chart-5: oklch(0.23 0.008 140.48);
}

.dark {
  --radius: 0.5rem;
  --background: oklch(0.152 0.016 139.798);
  --foreground: oklch(0.978 0.003 140.527);
  --muted: oklch(0.208 0.024 320.691);
  --muted-foreground: oklch(0.679 0.011 320.556);
  --popover: oklch(0.152 0.016 139.798);
  --popover-foreground: oklch(0.978 0.003 140.527);
  --card: oklch(0.152 0.016 139.798);
  --card-foreground: oklch(0.978 0.003 140.527);
  --border: oklch(0.278 0.03 256.848);
  --input: oklch(0.278 0.03 256.848);
  --primary: oklch(0.228 0.004 140.506);
  --primary-foreground: oklch(0.776 0.007 140.517);
  --secondary: oklch(0.225 0.004 320.558);
  --secondary-foreground: oklch(0.771 0.007 320.546);
  --accent: oklch(0.225 0.004 320.558);
  --accent-foreground: oklch(0.771 0.007 320.546);
  --destructive: oklch(0.6 0.221 31.854);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.228 0.004 140.506);
  --chart-1: oklch(0.228 0.004 140.506);
  --chart-2: oklch(0.225 0.004 320.558);
  --chart-3: oklch(0.225 0.004 320.558);
  --chart-4: oklch(0.257 0.005 320.56);
  --chart-5: oklch(0.23 0.008 140.48);
}