Button for shadcn/ui

Button is a shadcn/ui theme built around a muted deep blue primary color (#0d0e17) with muted deep violet accents (#110d17). The light mode uses a neutral background (#ffffff). Dark mode keeps the muted deep blue primary (#0d0e17) on a blue-tinted background (#06070f).

Color palette

TokenLightDark
Background
#ffffffwhite
#06070fblack
Foreground
#02040dblack
#f4f5fawhitesmoke
Card
#fcfcfcsnow
#070813black
Card foreground
#020309black
#f8f8fcghostwhite
Popover
#fcfcfcsnow
#070813black
Popover foreground
#020309black
#f8f8fcghostwhite
Primary
#0d0e17black
#0d0e17black
Primary foreground
#949ac2darkgray
#949ac2darkgray
Secondary
#0d1317black
#0d1317black
Secondary foreground
#94b1c2darkgray
#94b1c2darkgray
Muted
#d8dcdfgainsboro
#202527darkslategray
Muted foreground
#434c51darkslategray
#aeb7bcsilver
Accent
#110d17black
#110d17black
Accent foreground
#a594c2darkgray
#a594c2darkgray
Destructive
#b11f02firebrick
#fd5230tomato
Destructive foreground
#ffffffwhite
#000000black
Border
#e5e7eblavender
#1f2937darkslategray
Input
#e5e7eblavender
#1f2937darkslategray
Ring
#0d0e17black
#0d0e17black

Contrast

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

Light mode
Text on background20.47:1AAA
Text on card20.15:1AAA
Primary button7.00:1AAA
Secondary button8.30:1AAA
Muted text6.37:1AA
Accent6.96:1AA
Destructive6.86:1AA
Dark mode
Text on background18.48:1AAA
Text on card18.79:1AAA
Primary button7.00:1AAA
Secondary button8.30:1AAA
Muted text7.61:1AAA
Accent6.96:1AA
Destructive6.42:1AA

CSS variables

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

:root {
  --radius: 0.5rem;
  --background: oklch(1 0 180);
  --foreground: oklch(0.109 0.026 270.698);
  --muted: oklch(0.893 0.006 232.676);
  --muted-foreground: oklch(0.41 0.014 233.082);
  --popover: oklch(0.992 0 161.565);
  --popover-foreground: oklch(0.095 0.022 270.586);
  --card: oklch(0.992 0 161.565);
  --card-foreground: oklch(0.095 0.022 270.586);
  --border: oklch(0.928 0.006 264.531);
  --input: oklch(0.928 0.006 264.531);
  --primary: oklch(0.168 0.018 277.54);
  --primary-foreground: oklch(0.696 0.058 277.94);
  --secondary: oklch(0.183 0.012 233.676);
  --secondary-foreground: oklch(0.744 0.04 233.441);
  --accent: oklch(0.169 0.02 301.041);
  --accent-foreground: oklch(0.697 0.068 301.428);
  --destructive: oklch(0.49 0.184 32.191);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.168 0.018 277.54);
  --chart-1: oklch(0.168 0.018 277.54);
  --chart-2: oklch(0.183 0.012 233.676);
  --chart-3: oklch(0.169 0.02 301.041);
  --chart-4: oklch(0.217 0.016 233.878);
  --chart-5: oklch(0.167 0.02 277.289);
}

.dark {
  --radius: 0.5rem;
  --background: oklch(0.13 0.019 274.921);
  --foreground: oklch(0.972 0.007 279.236);
  --muted: oklch(0.26 0.008 233.055);
  --muted-foreground: oklch(0.774 0.012 232.797);
  --popover: oklch(0.141 0.023 275.374);
  --popover-foreground: oklch(0.981 0.004 279.272);
  --card: oklch(0.141 0.023 275.374);
  --card-foreground: oklch(0.981 0.004 279.272);
  --border: oklch(0.278 0.03 256.848);
  --input: oklch(0.278 0.03 256.848);
  --primary: oklch(0.168 0.018 277.54);
  --primary-foreground: oklch(0.696 0.058 277.94);
  --secondary: oklch(0.183 0.012 233.676);
  --secondary-foreground: oklch(0.744 0.04 233.441);
  --accent: oklch(0.169 0.02 301.041);
  --accent-foreground: oklch(0.697 0.068 301.428);
  --destructive: oklch(0.672 0.213 33.175);
  --destructive-foreground: oklch(0 0 0);
  --ring: oklch(0.168 0.018 277.54);
  --chart-1: oklch(0.168 0.018 277.54);
  --chart-2: oklch(0.183 0.012 233.676);
  --chart-3: oklch(0.169 0.02 301.041);
  --chart-4: oklch(0.217 0.016 233.878);
  --chart-5: oklch(0.167 0.02 277.289);
}