Discrete for shadcn/ui

Discrete is a shadcn/ui theme built around a near-black primary color (#090708) with near-black accents (#090707). The light mode uses a neutral background (#ffffff). Dark mode keeps the near-black primary (#090708) on a neutral background (#000000).

Color palette

TokenLightDark
Background
#ffffffwhite
#000000black
Foreground
#16030dblack
#fdfcfcsnow
Card
#fcfcfcsnow
#030303black
Card foreground
#12030bblack
#ffffffwhite
Popover
#ffffffwhite
#000000black
Popover foreground
#16030dblack
#fdfcfcsnow
Primary
#090708black
#090708black
Primary foreground
#ad94a1darkgray
#ad94a1darkgray
Secondary
#090709black
#090709black
Secondary foreground
#ac94addarkgray
#ac94addarkgray
Muted
#eddeedlavender
#211221black
Muted foreground
#514351darkslategray
#bcaebcsilver
Accent
#090707black
#090707black
Accent foreground
#ad9495rosybrown
#ad9495rosybrown
Destructive
#9d260bfirebrick
#f0512dtomato
Destructive foreground
#fde3demistyrose
#ffffffwhite
Border
#e5e7eblavender
#1f2937darkslategray
Input
#e5e7eblavender
#1f2937darkslategray
Ring
#090708black
#090708black

Contrast

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

Light mode
Text on background19.94:1AAA
Text on card19.69:1AAA
Primary button7.21:1AAA
Secondary button7.27:1AAA
Muted text7.15:1AAA
Accent7.13:1AAA
Destructive6.33:1AA
Dark mode
Text on background20.50:1AAA
Text on card20.67:1AAA
Primary button7.21:1AAA
Secondary button7.27:1AAA
Muted text8.46:1AAA
Accent7.13:1AAA
Destructive3.53:1AA Large

CSS variables

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

:root {
  --radius: 0.5rem;
  --background: oklch(1 0 180);
  --foreground: oklch(0.146 0.042 347.695);
  --muted: oklch(0.916 0.026 324.797);
  --muted-foreground: oklch(0.402 0.031 325.09);
  --popover: oklch(1 0 180);
  --popover-foreground: oklch(0.146 0.042 347.695);
  --card: oklch(0.992 0 161.565);
  --card-foreground: oklch(0.132 0.038 345.994);
  --border: oklch(0.928 0.006 264.531);
  --input: oklch(0.928 0.006 264.531);
  --primary: oklch(0.13 0.005 343.426);
  --primary-foreground: oklch(0.694 0.034 344.642);
  --secondary: oklch(0.131 0.006 324.997);
  --secondary-foreground: oklch(0.697 0.044 325.014);
  --accent: oklch(0.13 0.004 15.229);
  --accent-foreground: oklch(0.69 0.029 15.606);
  --destructive: oklch(0.46 0.16 33.359);
  --destructive-foreground: oklch(0.936 0.029 32.697);
  --ring: oklch(0.13 0.005 343.426);
  --chart-1: oklch(0.13 0.005 343.426);
  --chart-2: oklch(0.131 0.006 324.997);
  --chart-3: oklch(0.13 0.004 15.229);
  --chart-4: oklch(0.167 0.01 325.001);
  --chart-5: oklch(0.13 0.006 343.421);
}

.dark {
  --radius: 0.5rem;
  --background: oklch(0 0 0);
  --foreground: oklch(0.992 0.002 343.492);
  --muted: oklch(0.209 0.037 325.646);
  --muted-foreground: oklch(0.766 0.026 324.834);
  --popover: oklch(0 0 0);
  --popover-foreground: oklch(0.992 0.002 343.492);
  --card: oklch(0.092 0 180);
  --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.13 0.005 343.426);
  --primary-foreground: oklch(0.694 0.034 344.642);
  --secondary: oklch(0.131 0.006 324.997);
  --secondary-foreground: oklch(0.697 0.044 325.014);
  --accent: oklch(0.13 0.004 15.229);
  --accent-foreground: oklch(0.69 0.029 15.606);
  --destructive: oklch(0.65 0.202 34.016);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.13 0.005 343.426);
  --chart-1: oklch(0.13 0.005 343.426);
  --chart-2: oklch(0.131 0.006 324.997);
  --chart-3: oklch(0.13 0.004 15.229);
  --chart-4: oklch(0.167 0.01 325.001);
  --chart-5: oklch(0.13 0.006 343.421);
}