Transparency for shadcn/ui

Transparency is a shadcn/ui theme built around a near-white primary color (#fefcfb) with muted light red accents (#cfc6c4). The light mode uses a neutral background (#fcf9f8). Dark mode keeps the near-white primary (#fefcfb) on a red-tinted background (#0f0705).

Color palette

TokenLightDark
Background
#fcf9f8snow
#0f0705black
Foreground
#040101black
#faf6f5whitesmoke
Card
#fcf9f8snow
#0f0705black
Card foreground
#040101black
#faf6f5whitesmoke
Popover
#fcf9f8snow
#0f0705black
Popover foreground
#040101black
#faf6f5whitesmoke
Primary
#fefcfbsnow
#fefcfbsnow
Primary foreground
#954432sienna
#954432sienna
Secondary
#e1e0dfgainsboro
#222020black
Secondary foreground
#4a4645darkslategray
#bdb8b7silver
Muted
#f7efeelinen
#110a08black
Muted foreground
#636363dimgray
#9c9c9cdarkgray
Accent
#cfc6c4silver
#413735darkslategray
Accent foreground
#362d2bdarkslategray
#d8d1cflightgrey
Destructive
#991706darkred
#f8503atomato
Destructive foreground
#fdd8d3mistyrose
#000000black
Border
#e5e7eblavender
#1f2937darkslategray
Input
#e5e7eblavender
#1f2937darkslategray
Ring
#fefcfbsnow
#fefcfbsnow

Contrast

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

Light mode
Text on background19.81:1AAA
Text on card19.81:1AAA
Primary button6.49:1AA
Secondary button7.06:1AAA
Muted text5.31:1AA
Accent7.98:1AAA
Destructive6.45:1AA
Dark mode
Text on background18.57:1AAA
Text on card18.57:1AAA
Primary button6.49:1AA
Secondary button8.23:1AAA
Muted text7.14:1AAA
Accent7.66:1AAA
Destructive6.20:1AA

CSS variables

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

:root {
  --radius: 0.5rem;
  --background: oklch(0.984 0.003 32.661);
  --foreground: oklch(0.086 0.014 41.188);
  --muted: oklch(0.959 0.008 32.662);
  --muted-foreground: oklch(0.501 0 180);
  --popover: oklch(0.984 0.003 32.661);
  --popover-foreground: oklch(0.086 0.014 41.188);
  --card: oklch(0.984 0.003 32.661);
  --card-foreground: oklch(0.086 0.014 41.188);
  --border: oklch(0.928 0.006 264.531);
  --input: oklch(0.928 0.006 264.531);
  --primary: oklch(0.991 0.002 32.661);
  --primary-foreground: oklch(0.488 0.114 34.015);
  --secondary: oklch(0.907 0.002 32.661);
  --secondary-foreground: oklch(0.397 0.005 32.664);
  --accent: oklch(0.833 0.011 32.665);
  --accent-foreground: oklch(0.306 0.013 32.734);
  --destructive: oklch(0.438 0.166 30.98);
  --destructive-foreground: oklch(0.912 0.043 26.824);
  --ring: oklch(0.991 0.002 32.661);
  --chart-1: oklch(0.991 0.002 32.661);
  --chart-2: oklch(0.907 0.002 32.661);
  --chart-3: oklch(0.833 0.011 32.665);
  --chart-4: oklch(0.931 0.001 32.661);
  --chart-5: oklch(0.991 0.002 32.661);
}

.dark {
  --radius: 0.5rem;
  --background: oklch(0.14 0.017 36.948);
  --foreground: oklch(0.975 0.004 32.661);
  --muted: oklch(0.154 0.014 33.852);
  --muted-foreground: oklch(0.691 0 180);
  --popover: oklch(0.14 0.017 36.948);
  --popover-foreground: oklch(0.975 0.004 32.661);
  --card: oklch(0.14 0.017 36.948);
  --card-foreground: oklch(0.975 0.004 32.661);
  --border: oklch(0.278 0.03 256.848);
  --input: oklch(0.278 0.03 256.848);
  --primary: oklch(0.991 0.002 32.661);
  --primary-foreground: oklch(0.488 0.114 34.015);
  --secondary: oklch(0.247 0.003 32.666);
  --secondary-foreground: oklch(0.787 0.005 32.661);
  --accent: oklch(0.346 0.014 32.726);
  --accent-foreground: oklch(0.866 0.008 32.662);
  --destructive: oklch(0.662 0.207 30.713);
  --destructive-foreground: oklch(0 0 0);
  --ring: oklch(0.991 0.002 32.661);
  --chart-1: oklch(0.991 0.002 32.661);
  --chart-2: oklch(0.247 0.003 32.666);
  --chart-3: oklch(0.346 0.014 32.726);
  --chart-4: oklch(0.279 0.004 32.667);
  --chart-5: oklch(0.991 0.002 32.661);
}