General for shadcn/ui

General is a shadcn/ui theme built around a deep violet primary color (#100817) with muted light violet accents (#c7bcd2). The light mode uses a neutral background (#ffffff). Dark mode keeps the deep violet primary (#100817) on a violet-tinted background (#0a060e).

Color palette

TokenLightDark
Background
#ffffffwhite
#0a060eblack
Foreground
#08020dblack
#ffffffwhite
Card
#ffffffwhite
#0a060eblack
Card foreground
#08020dblack
#ffffffwhite
Popover
#ffffffwhite
#0a060eblack
Popover foreground
#08020dblack
#ffffffwhite
Primary
#100817black
#100817black
Primary foreground
#aa7fd2mediumpurple
#aa7fd2mediumpurple
Secondary
#e1dde4gainsboro
#151018black
Secondary foreground
#48404fdarkslategray
#ae9dbedarkgray
Muted
#ebe6eflavender
#151019black
Muted foreground
#595959dimgray
#a6a6a6darkgray
Accent
#c7bcd2thistle
#241a2dblack
Accent foreground
#2e2537darkslategray
#bdabcesilver
Destructive
#760a0amaroon
#ec1818red
Destructive foreground
#f9b8b8lightpink
#ffffffwhite
Border
#e5e7eblavender
#1f2937darkslategray
Input
#e5e7eblavender
#1f2937darkslategray
Ring
#100817black
#100817black

Contrast

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

Light mode
Text on background20.49:1AAA
Text on card20.49:1AAA
Primary button6.25:1AA
Secondary button7.37:1AAA
Muted text5.71:1AA
Accent8.03:1AAA
Destructive6.92:1AA
Dark mode
Text on background20.06:1AAA
Text on card20.06:1AAA
Primary button6.25:1AA
Secondary button7.46:1AAA
Muted text7.70:1AAA
Accent7.81:1AAA
Destructive4.45:1AA Large

CSS variables

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

:root {
  --radius: 0.5rem;
  --background: oklch(1 0 180);
  --foreground: oklch(0.113 0.033 310.758);
  --muted: oklch(0.932 0.012 308.986);
  --muted-foreground: oklch(0.465 0 180);
  --popover: oklch(1 0 180);
  --popover-foreground: oklch(0.113 0.033 310.758);
  --card: oklch(1 0 180);
  --card-foreground: oklch(0.113 0.033 310.758);
  --border: oklch(0.928 0.006 264.531);
  --input: oklch(0.928 0.006 264.531);
  --primary: oklch(0.154 0.033 306.973);
  --primary-foreground: oklch(0.669 0.128 307.036);
  --secondary: oklch(0.902 0.01 309.011);
  --secondary-foreground: oklch(0.384 0.028 308.354);
  --accent: oklch(0.811 0.034 308.692);
  --accent-foreground: oklch(0.282 0.035 307.794);
  --destructive: oklch(0.361 0.14 28.033);
  --destructive-foreground: oklch(0.843 0.076 18.775);
  --ring: oklch(0.154 0.033 306.973);
  --chart-1: oklch(0.154 0.033 306.973);
  --chart-2: oklch(0.902 0.01 309.011);
  --chart-3: oklch(0.811 0.034 308.692);
  --chart-4: oklch(0.927 0.007 309.043);
  --chart-5: oklch(0.153 0.035 306.877);
}

.dark {
  --radius: 0.5rem;
  --background: oklch(0.135 0.02 308.908);
  --foreground: oklch(1 0 180);
  --muted: oklch(0.183 0.018 308.063);
  --muted-foreground: oklch(0.724 0 180);
  --popover: oklch(0.135 0.02 308.908);
  --popover-foreground: oklch(1 0 180);
  --card: oklch(0.135 0.02 308.908);
  --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.154 0.033 306.973);
  --primary-foreground: oklch(0.669 0.128 307.036);
  --secondary: oklch(0.184 0.018 308.117);
  --secondary-foreground: oklch(0.722 0.05 308.397);
  --accent: oklch(0.24 0.037 307.467);
  --accent-foreground: oklch(0.769 0.052 308.415);
  --destructive: oklch(0.599 0.237 28.403);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.154 0.033 306.973);
  --chart-1: oklch(0.154 0.033 306.973);
  --chart-2: oklch(0.184 0.018 308.117);
  --chart-3: oklch(0.24 0.037 307.467);
  --chart-4: oklch(0.214 0.023 307.981);
  --chart-5: oklch(0.153 0.035 306.877);
}