Necessary for shadcn/ui

Necessary is a shadcn/ui theme built around a deep red primary color (#110305) with muted red accents (#d2adb3). The light mode uses a neutral background (#ffffff). Dark mode keeps the deep red primary (#110305) on a neutral background (#070304).

Color palette

TokenLightDark
Background
#ffffffwhite
#070304black
Foreground
#150507black
#fdfcfcsnow
Card
#fcfcfcsnow
#0a0506black
Card foreground
#110406black
#ffffffwhite
Popover
#fcfcfcsnow
#0a0506black
Popover foreground
#110406black
#ffffffwhite
Primary
#110305black
#110305black
Primary foreground
#e46278palevioletred
#e46278palevioletred
Secondary
#deced1lightgrey
#171212black
Secondary foreground
#493135darkslategray
#b9a2a6darkgray
Muted
#e0d2d4lightgrey
#2d1f22black
Muted foreground
#594a4ddarkslategray
#b5a6a9darkgray
Accent
#d2adb3silver
#342225darkslategray
Accent foreground
#311b1fblack
#d1b8bcsilver
Destructive
#ac1602firebrick
#fd3b21orangered
Destructive foreground
#ffe4e1mistyrose
#ffffffwhite
Border
#e5e7eblavender
#1f2937darkslategray
Input
#e5e7eblavender
#1f2937darkslategray
Ring
#110305black
#110305black

Contrast

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

Light mode
Text on background19.87:1AAA
Text on card19.68:1AAA
Primary button6.07:1AA
Secondary button7.81:1AAA
Muted text5.70:1AA
Accent7.91:1AAA
Destructive6.09:1AA
Dark mode
Text on background20.00:1AAA
Text on card20.24:1AAA
Primary button6.07:1AA
Secondary button7.77:1AAA
Muted text6.73:1AA
Accent8.02:1AAA
Destructive3.61:1AA Large

CSS variables

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

:root {
  --radius: 0.5rem;
  --background: oklch(1 0 180);
  --foreground: oklch(0.144 0.032 8.819);
  --muted: oklch(0.875 0.016 5.906);
  --muted-foreground: oklch(0.426 0.02 6.658);
  --popover: oklch(0.992 0 161.565);
  --popover-foreground: oklch(0.132 0.028 7.494);
  --card: oklch(0.992 0 161.565);
  --card-foreground: oklch(0.132 0.028 7.494);
  --border: oklch(0.928 0.006 264.531);
  --input: oklch(0.928 0.006 264.531);
  --primary: oklch(0.13 0.032 7.793);
  --primary-foreground: oklch(0.664 0.163 12.417);
  --secondary: oklch(0.866 0.019 5.999);
  --secondary-foreground: oklch(0.343 0.036 8.146);
  --accent: oklch(0.781 0.044 6.877);
  --accent-foreground: oklch(0.254 0.036 9.079);
  --destructive: oklch(0.475 0.184 30.922);
  --destructive-foreground: oklch(0.94 0.03 26.679);
  --ring: oklch(0.13 0.032 7.793);
  --chart-1: oklch(0.13 0.032 7.793);
  --chart-2: oklch(0.866 0.019 5.999);
  --chart-3: oklch(0.781 0.044 6.877);
  --chart-4: oklch(0.891 0.015 5.88);
  --chart-5: oklch(0.129 0.034 7.929);
}

.dark {
  --radius: 0.5rem;
  --background: oklch(0.109 0.011 5.764);
  --foreground: oklch(0.992 0.001 5.487);
  --muted: oklch(0.259 0.022 7.59);
  --muted-foreground: oklch(0.739 0.017 6.053);
  --popover: oklch(0.125 0.012 5.765);
  --popover-foreground: oklch(1 0 180);
  --card: oklch(0.125 0.012 5.765);
  --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.032 7.793);
  --primary-foreground: oklch(0.664 0.163 12.417);
  --secondary: oklch(0.188 0.01 6.759);
  --secondary-foreground: oklch(0.733 0.027 6.4);
  --accent: oklch(0.277 0.028 8.072);
  --accent-foreground: oklch(0.805 0.029 6.361);
  --destructive: oklch(0.649 0.232 31.041);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.13 0.032 7.793);
  --chart-1: oklch(0.13 0.032 7.793);
  --chart-2: oklch(0.188 0.01 6.759);
  --chart-3: oklch(0.277 0.028 8.072);
  --chart-4: oklch(0.22 0.013 6.932);
  --chart-5: oklch(0.129 0.034 7.929);
}