Razor for shadcn/ui

Razor is a shadcn/ui theme built around a near-black primary color (#030104) with near-black accents (#020401). The light mode uses a neutral background (#fdfcfd). Dark mode keeps the near-black primary (#030104) on a violet-tinted background (#09040c).

Color palette

TokenLightDark
Background
#fdfcfdwhite
#09040cblack
Foreground
#000000black
#f8f5fawhitesmoke
Card
#faf8fbghostwhite
#0c0510black
Card foreground
#000000black
#fbf8fcghostwhite
Popover
#faf8fbghostwhite
#0c0510black
Popover foreground
#000000black
#fbf8fcghostwhite
Primary
#030104black
#030104black
Primary foreground
#d9afefplum
#d9afefplum
Secondary
#020401black
#020401black
Secondary foreground
#52ae24olivedrab
#52ae24olivedrab
Muted
#e9eee7linen
#131811black
Muted foreground
#5c6756dimgray
#9ea998darkgray
Accent
#020401black
#020401black
Accent foreground
#52ae24olivedrab
#52ae24olivedrab
Destructive
#aa1f13firebrick
#d82818firebrick
Destructive foreground
#fdf2f1seashell
#ffffffwhite
Border
#e5e7eblavender
#1f2937darkslategray
Input
#e5e7eblavender
#1f2937darkslategray
Ring
#030104black
#030104black

Contrast

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

Light mode
Text on background20.46:1AAA
Text on card19.94:1AAA
Primary button11.22:1AAA
Secondary button7.28:1AAA
Muted text5.07:1AA
Accent7.28:1AAA
Destructive6.56:1AA
Dark mode
Text on background18.82:1AAA
Text on card19.09:1AAA
Primary button11.22:1AAA
Secondary button7.28:1AAA
Muted text7.34:1AAA
Accent7.28:1AAA
Destructive4.96:1AA

CSS variables

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

:root {
  --radius: 0.5rem;
  --background: oklch(0.991 0.002 314.815);
  --foreground: oklch(0 0 0);
  --muted: oklch(0.944 0.012 134.888);
  --muted-foreground: oklch(0.498 0.03 135.136);
  --popover: oklch(0.983 0.005 314.804);
  --popover-foreground: oklch(0 0 0);
  --card: oklch(0.983 0.005 314.804);
  --card-foreground: oklch(0 0 0);
  --border: oklch(0.928 0.006 264.531);
  --input: oklch(0.928 0.006 264.531);
  --primary: oklch(0.081 0.022 317.148);
  --primary-foreground: oklch(0.812 0.099 314.226);
  --secondary: oklch(0.101 0.019 132.981);
  --secondary-foreground: oklch(0.667 0.189 137.771);
  --accent: oklch(0.101 0.019 132.981);
  --accent-foreground: oklch(0.667 0.189 137.771);
  --destructive: oklch(0.478 0.175 29.986);
  --destructive-foreground: oklch(0.97 0.012 23.706);
  --ring: oklch(0.081 0.022 317.148);
  --chart-1: oklch(0.081 0.022 317.148);
  --chart-2: oklch(0.101 0.019 132.981);
  --chart-3: oklch(0.101 0.019 132.981);
  --chart-4: oklch(0.163 0.033 134.012);
  --chart-5: oklch(0.08 0.023 317.273);
}

.dark {
  --radius: 0.5rem;
  --background: oklch(0.12 0.025 316.399);
  --foreground: oklch(0.973 0.008 314.785);
  --muted: oklch(0.202 0.017 135.274);
  --muted-foreground: oklch(0.721 0.027 135.018);
  --popover: oklch(0.133 0.029 315.08);
  --popover-foreground: oklch(0.982 0.006 314.799);
  --card: oklch(0.133 0.029 315.08);
  --card-foreground: oklch(0.982 0.006 314.799);
  --border: oklch(0.278 0.03 256.848);
  --input: oklch(0.278 0.03 256.848);
  --primary: oklch(0.081 0.022 317.148);
  --primary-foreground: oklch(0.812 0.099 314.226);
  --secondary: oklch(0.101 0.019 132.981);
  --secondary-foreground: oklch(0.667 0.189 137.771);
  --accent: oklch(0.101 0.019 132.981);
  --accent-foreground: oklch(0.667 0.189 137.771);
  --destructive: oklch(0.57 0.212 30.036);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.081 0.022 317.148);
  --chart-1: oklch(0.081 0.022 317.148);
  --chart-2: oklch(0.101 0.019 132.981);
  --chart-3: oklch(0.101 0.019 132.981);
  --chart-4: oklch(0.163 0.033 134.012);
  --chart-5: oklch(0.08 0.023 317.273);
}