Physics for shadcn/ui

Physics is a shadcn/ui theme built around a neutral gray primary color (#aeafac) with neutral gray accents (#adafac). The light mode uses a neutral background (#ffffff). Dark mode keeps the neutral gray primary (#aeafac) on a green-tinted background (#0c0e06).

Color palette

TokenLightDark
Background
#ffffffwhite
#0c0e06black
Foreground
#060802black
#fbfcf8snow
Card
#ffffffwhite
#0c0e06black
Card foreground
#060802black
#fbfcf8snow
Popover
#ffffffwhite
#0c0e06black
Popover foreground
#060802black
#fbfcf8snow
Primary
#aeafacdarkgray
#aeafacdarkgray
Primary foreground
#151514black
#151514black
Secondary
#afaeacdarkgray
#afaeacdarkgray
Secondary foreground
#151514black
#151514black
Muted
#f1efealinen
#15140eblack
Muted foreground
#595854dimgray
#abaaa6darkgray
Accent
#adafacdarkgray
#adafacdarkgray
Accent foreground
#141514black
#141514black
Destructive
#a10202darkred
#fb1818red
Destructive foreground
#fed7d7mistyrose
#ffffffwhite
Border
#e5e7eblavender
#1f2937darkslategray
Input
#e5e7eblavender
#1f2937darkslategray
Ring
#aeafacdarkgray
#aeafacdarkgray

Contrast

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

Light mode
Text on background20.12:1AAA
Text on card20.12:1AAA
Primary button8.29:1AAA
Secondary button8.25:1AAA
Muted text6.19:1AA
Accent8.27:1AAA
Destructive6.31:1AA
Dark mode
Text on background18.84:1AAA
Text on card18.84:1AAA
Primary button8.29:1AAA
Secondary button8.25:1AAA
Muted text7.93:1AAA
Accent8.27:1AAA
Destructive3.99:1AA Large

CSS variables

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

:root {
  --radius: 0.5rem;
  --background: oklch(1 0 180);
  --foreground: oklch(0.129 0.019 118.652);
  --muted: oklch(0.952 0.008 92.734);
  --muted-foreground: oklch(0.461 0.007 92.792);
  --popover: oklch(1 0 180);
  --popover-foreground: oklch(0.129 0.019 118.652);
  --card: oklch(1 0 180);
  --card-foreground: oklch(0.129 0.019 118.652);
  --border: oklch(0.928 0.006 264.531);
  --input: oklch(0.928 0.006 264.531);
  --primary: oklch(0.752 0.005 118.675);
  --primary-foreground: oklch(0.194 0.002 118.714);
  --secondary: oklch(0.752 0.004 92.705);
  --secondary-foreground: oklch(0.194 0.001 92.721);
  --accent: oklch(0.751 0.005 138.338);
  --accent-foreground: oklch(0.194 0.002 138.34);
  --destructive: oklch(0.446 0.182 29.064);
  --destructive-foreground: oklch(0.912 0.044 17.995);
  --ring: oklch(0.752 0.005 118.675);
  --chart-1: oklch(0.752 0.005 118.675);
  --chart-2: oklch(0.752 0.004 92.705);
  --chart-3: oklch(0.751 0.005 138.338);
  --chart-4: oklch(0.776 0.003 92.698);
  --chart-5: oklch(0.758 0.012 118.836);
}

.dark {
  --radius: 0.5rem;
  --background: oklch(0.159 0.017 119.789);
  --foreground: oklch(0.989 0.005 118.658);
  --muted: oklch(0.19 0.011 93.096);
  --muted-foreground: oklch(0.737 0.006 92.734);
  --popover: oklch(0.159 0.017 119.789);
  --popover-foreground: oklch(0.989 0.005 118.658);
  --card: oklch(0.159 0.017 119.789);
  --card-foreground: oklch(0.989 0.005 118.658);
  --border: oklch(0.278 0.03 256.848);
  --input: oklch(0.278 0.03 256.848);
  --primary: oklch(0.752 0.005 118.675);
  --primary-foreground: oklch(0.194 0.002 118.714);
  --secondary: oklch(0.752 0.004 92.705);
  --secondary-foreground: oklch(0.194 0.001 92.721);
  --accent: oklch(0.751 0.005 138.338);
  --accent-foreground: oklch(0.194 0.002 138.34);
  --destructive: oklch(0.627 0.249 28.504);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.752 0.005 118.675);
  --chart-1: oklch(0.752 0.005 118.675);
  --chart-2: oklch(0.752 0.004 92.705);
  --chart-3: oklch(0.751 0.005 138.338);
  --chart-4: oklch(0.776 0.003 92.698);
  --chart-5: oklch(0.758 0.012 118.836);
}