Perspective for shadcn/ui

Perspective is a shadcn/ui theme built around a vivid deep indigo primary color (#010332) with vivid deep green accents (#033201). The light mode uses a neutral background (#ffffff). Dark mode keeps the vivid deep indigo primary (#010332) on an indigo-tinted background (#05050a).

Color palette

TokenLightDark
Background
#ffffffwhite
#05050ablack
Foreground
#03040cblack
#fcfcfdwhite
Card
#fcfcfcsnow
#07070eblack
Card foreground
#020208black
#ffffffwhite
Popover
#fcfcfcsnow
#07070eblack
Popover foreground
#020208black
#ffffffwhite
Primary
#010332black
#010332black
Primary foreground
#cdcffelavender
#cdcffelavender
Secondary
#320103black
#320103black
Secondary foreground
#fc696esalmon
#fc696esalmon
Muted
#ece4e4linen
#1b1313black
Muted foreground
#6b6161dimgray
#9e9494rosybrown
Accent
#033201black
#033201black
Accent foreground
#0dfa05lime
#0dfa05lime
Destructive
#9f1604darkred
#f92b10orangered
Destructive foreground
#fedcd7mistyrose
#ffffffwhite
Border
#e5e7eblavender
#1f2937darkslategray
Input
#e5e7eblavender
#1f2937darkslategray
Ring
#010332black
#010332black

Contrast

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

Light mode
Text on background20.45:1AAA
Text on card20.24:1AAA
Primary button13.17:1AAA
Secondary button6.47:1AA
Muted text4.78:1AA
Accent10.06:1AAA
Destructive6.33:1AA
Dark mode
Text on background19.81:1AAA
Text on card20.09:1AAA
Primary button13.17:1AAA
Secondary button6.47:1AA
Muted text6.19:1AA
Accent10.06:1AAA
Destructive3.90:1AA Large

CSS variables

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

:root {
  --radius: 0.5rem;
  --background: oklch(1 0 180);
  --foreground: oklch(0.11 0.023 279.545);
  --muted: oklch(0.925 0.009 14.973);
  --muted-foreground: oklch(0.502 0.013 15.284);
  --popover: oklch(0.992 0 161.565);
  --popover-foreground: oklch(0.096 0.02 279.567);
  --card: oklch(0.992 0 161.565);
  --card-foreground: oklch(0.096 0.02 279.567);
  --border: oklch(0.928 0.006 264.531);
  --input: oklch(0.928 0.006 264.531);
  --primary: oklch(0.153 0.093 266.002);
  --primary-foreground: oklch(0.868 0.065 283.393);
  --secondary: oklch(0.201 0.079 25.85);
  --secondary-foreground: oklch(0.705 0.18 20.937);
  --accent: oklch(0.276 0.091 142.098);
  --accent-foreground: oklch(0.854 0.289 142.427);
  --destructive: oklch(0.451 0.172 30.964);
  --destructive-foreground: oklch(0.921 0.039 26.775);
  --ring: oklch(0.153 0.093 266.002);
  --chart-1: oklch(0.153 0.093 266.002);
  --chart-2: oklch(0.201 0.079 25.85);
  --chart-3: oklch(0.276 0.091 142.098);
  --chart-4: oklch(0.238 0.094 26.54);
  --chart-5: oklch(0.151 0.096 264.671);
}

.dark {
  --radius: 0.5rem;
  --background: oklch(0.12 0.014 282.236);
  --foreground: oklch(0.991 0.001 284.784);
  --muted: oklch(0.197 0.014 16.154);
  --muted-foreground: oklch(0.675 0.012 15.128);
  --popover: oklch(0.132 0.016 282.214);
  --popover-foreground: oklch(1 0 180);
  --card: oklch(0.132 0.016 282.214);
  --card-foreground: oklch(1 0 180);
  --border: oklch(0.278 0.03 256.848);
  --input: oklch(0.278 0.03 256.848);
  --primary: oklch(0.153 0.093 266.002);
  --primary-foreground: oklch(0.868 0.065 283.393);
  --secondary: oklch(0.201 0.079 25.85);
  --secondary-foreground: oklch(0.705 0.18 20.937);
  --accent: oklch(0.276 0.091 142.098);
  --accent-foreground: oklch(0.854 0.289 142.427);
  --destructive: oklch(0.631 0.239 30.872);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.153 0.093 266.002);
  --chart-1: oklch(0.153 0.093 266.002);
  --chart-2: oklch(0.201 0.079 25.85);
  --chart-3: oklch(0.276 0.091 142.098);
  --chart-4: oklch(0.238 0.094 26.54);
  --chart-5: oklch(0.151 0.096 264.671);
}