Niche for shadcn/ui

Niche is a shadcn/ui theme built around a near-black primary color (#040201) with near-black accents (#040301). The light mode uses a neutral background (#fdf8f6). Dark mode keeps the near-black primary (#040201) on a red-tinted background (#0c0503).

Color palette

TokenLightDark
Background
#fdf8f6snow
#0c0503black
Foreground
#170703black
#ffffffwhite
Card
#fcf4f2seashell
#100705black
Card foreground
#120602black
#ffffffwhite
Popover
#fdf8f6snow
#0c0503black
Popover foreground
#170703black
#ffffffwhite
Primary
#040201black
#040201black
Primary foreground
#ca816drosybrown
#ca816drosybrown
Secondary
#040102black
#040102black
Secondary foreground
#e5b8c5thistle
#e5b8c5thistle
Muted
#e2dfe0gainsboro
#201d1eblack
Muted foreground
#544549darkslategray
#baabafdarkgray
Accent
#040301black
#040301black
Accent foreground
#cab06ddarkkhaki
#cab06ddarkkhaki
Destructive
#812d09saddlebrown
#ef5a1achocolate
Destructive foreground
#fbd2c1peachpuff
#ffffffwhite
Border
#e5e7eblavender
#1f2937darkslategray
Input
#e5e7eblavender
#1f2937darkslategray
Ring
#040201black
#040201black

Contrast

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

Light mode
Text on background18.67:1AAA
Text on card18.46:1AAA
Primary button6.78:1AA
Secondary button11.85:1AAA
Muted text6.80:1AA
Accent9.75:1AAA
Destructive6.54:1AA
Dark mode
Text on background20.19:1AAA
Text on card19.92:1AAA
Primary button6.78:1AA
Secondary button11.85:1AAA
Muted text7.59:1AAA
Accent9.75:1AAA
Destructive3.41:1AA Large

CSS variables

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

:root {
  --radius: 0.5rem;
  --background: oklch(0.983 0.006 35.991);
  --foreground: oklch(0.153 0.032 43.221);
  --muted: oklch(0.905 0.004 357.848);
  --muted-foreground: oklch(0.407 0.022 359.213);
  --popover: oklch(0.983 0.006 35.991);
  --popover-foreground: oklch(0.153 0.032 43.221);
  --card: oklch(0.974 0.009 35.982);
  --card-foreground: oklch(0.14 0.028 45.12);
  --border: oklch(0.928 0.006 264.531);
  --input: oklch(0.928 0.006 264.531);
  --primary: oklch(0.089 0.009 41.566);
  --primary-foreground: oklch(0.675 0.096 36.203);
  --secondary: oklch(0.085 0.012 357.532);
  --secondary-foreground: oklch(0.826 0.055 359.555);
  --accent: oklch(0.098 0.01 93.364);
  --accent-foreground: oklch(0.765 0.091 88.63);
  --destructive: oklch(0.416 0.124 39.862);
  --destructive-foreground: oklch(0.895 0.051 44.494);
  --ring: oklch(0.089 0.009 41.566);
  --chart-1: oklch(0.089 0.009 41.566);
  --chart-2: oklch(0.085 0.012 357.532);
  --chart-3: oklch(0.098 0.01 93.364);
  --chart-4: oklch(0.136 0.02 358.892);
  --chart-5: oklch(0.088 0.01 42.02);
}

.dark {
  --radius: 0.5rem;
  --background: oklch(0.127 0.016 42.572);
  --foreground: oklch(1 0 180);
  --muted: oklch(0.234 0.006 358.436);
  --muted-foreground: oklch(0.755 0.019 358.411);
  --popover: oklch(0.127 0.016 42.572);
  --popover-foreground: oklch(1 0 180);
  --card: oklch(0.141 0.018 41.087);
  --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.089 0.009 41.566);
  --primary-foreground: oklch(0.675 0.096 36.203);
  --secondary: oklch(0.085 0.012 357.532);
  --secondary-foreground: oklch(0.826 0.055 359.555);
  --accent: oklch(0.098 0.01 93.364);
  --accent-foreground: oklch(0.765 0.091 88.63);
  --destructive: oklch(0.657 0.196 39.799);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.089 0.009 41.566);
  --chart-1: oklch(0.089 0.009 41.566);
  --chart-2: oklch(0.085 0.012 357.532);
  --chart-3: oklch(0.098 0.01 93.364);
  --chart-4: oklch(0.136 0.02 358.892);
  --chart-5: oklch(0.088 0.01 42.02);
}