supabase theme for shadcn/ui

supabase theme is a shadcn/ui theme built around a green primary color (#37d277) with near-white accents (#f3f3f3). The light mode uses a neutral background (#ffffff). Dark mode switches to a teal primary (#2cc87e) on an indigo-tinted background (#06040b).

Color palette

TokenLightDark
Background
#ffffffwhite
#06040bblack
Foreground
#080515black
#ffffffwhite
Card
#fcfcfcsnow
#07060eblack
Card foreground
#060410black
#ffffffwhite
Popover
#ffffffwhite
#06040bblack
Popover foreground
#080515black
#ffffffwhite
Primary
#37d277mediumseagreen
#2cc87emediumseagreen
Primary foreground
#ffffffwhite
#ffffffwhite
Secondary
#c4ebd4lightgrey
#1a291fblack
Secondary foreground
#2d2a3cdarkslategray
#37d26emediumseagreen
Muted
#dfdee3gainsboro
#1d1c21black
Muted foreground
#494659darkslategray
#aaa6b9darkgray
Accent
#f3f3f3whitesmoke
#191b1bblack
Accent foreground
#2d2a3cdarkslategray
#c5cec7silver
Destructive
#db1006red
#f91c10red
Destructive foreground
#ffffffwhite
#ffffffwhite
Border
#f1f0f4whitesmoke
#17161dblack
Input
#f1f0f4whitesmoke
#17161dblack
Ring
#6756b3slateblue
#6756b3slateblue

Contrast

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

Light mode
Text on background20.13:1AAA
Text on card19.89:1AAA
Primary button1.97:1Fail
Secondary button10.76:1AAA
Muted text6.79:1AA
Accent12.57:1AAA
Destructive5.14:1AA
Dark mode
Text on background20.36:1AAA
Text on card20.15:1AAA
Primary button2.17:1Fail
Secondary button7.66:1AAA
Muted text7.15:1AAA
Accent10.69:1AAA
Destructive4.04:1AA Large

CSS variables

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

:root {
  --radius: 0.5rem;
  --background: oklch(1 0 180);
  --foreground: oklch(0.131 0.036 291.028);
  --muted: oklch(0.902 0.008 294.669);
  --muted-foreground: oklch(0.403 0.032 293.327);
  --popover: oklch(1 0 180);
  --popover-foreground: oklch(0.131 0.036 291.028);
  --card: oklch(0.992 0 161.565);
  --card-foreground: oklch(0.121 0.031 292.236);
  --border: oklch(0.958 0.005 294.724);
  --input: oklch(0.958 0.005 294.724);
  --primary: oklch(0.764 0.18 152.56);
  --primary-foreground: oklch(1 0 180);
  --secondary: oklch(0.907 0.051 159.432);
  --secondary-foreground: oklch(0.296 0.033 292.659);
  --accent: oklch(0.965 0 180);
  --accent-foreground: oklch(0.296 0.033 292.659);
  --destructive: oklch(0.563 0.226 29.55);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.516 0.142 288.865);
  --chart-1: oklch(0.764 0.18 152.56);
  --chart-2: oklch(0.907 0.051 159.432);
  --chart-3: oklch(0.965 0 180);
  --chart-4: oklch(0.925 0.041 159.742);
  --chart-5: oklch(0.772 0.187 152.208);
}

.dark {
  --radius: 0.5rem;
  --background: oklch(0.117 0.018 293.95);
  --foreground: oklch(1 0 180);
  --muted: oklch(0.229 0.011 293.955);
  --muted-foreground: oklch(0.736 0.027 294.129);
  --popover: oklch(0.117 0.018 293.95);
  --popover-foreground: oklch(1 0 180);
  --card: oklch(0.13 0.02 293.273);
  --card-foreground: oklch(1 0 180);
  --border: oklch(0.204 0.015 293.41);
  --input: oklch(0.204 0.015 293.41);
  --primary: oklch(0.738 0.165 156.779);
  --primary-foreground: oklch(1 0 180);
  --secondary: oklch(0.265 0.028 155.739);
  --secondary-foreground: oklch(0.763 0.189 150.403);
  --accent: oklch(0.221 0.004 172.554);
  --accent-foreground: oklch(0.843 0.015 152.696);
  --destructive: oklch(0.624 0.246 29.458);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.516 0.142 288.865);
  --chart-1: oklch(0.738 0.165 156.779);
  --chart-2: oklch(0.265 0.028 155.739);
  --chart-3: oklch(0.221 0.004 172.554);
  --chart-4: oklch(0.299 0.033 155.598);
  --chart-5: oklch(0.747 0.17 156.364);
}