Explanation for shadcn/ui

Explanation is a shadcn/ui theme built around a blue primary color (#1f3393) with violet accents (#461f93). The light mode uses a neutral background (#f8f9fc). Dark mode keeps the blue primary (#1f3393) on a neutral background (#020308).

Color palette

TokenLightDark
Background
#f8f9fcghostwhite
#020308black
Foreground
#010104black
#fcfcfdwhite
Card
#f8f9fcghostwhite
#020308black
Card foreground
#010104black
#fcfcfdwhite
Popover
#f8f9fcghostwhite
#020308black
Popover foreground
#010104black
#fcfcfdwhite
Primary
#1f3393darkslateblue
#1f3393darkslateblue
Primary foreground
#eaedfblavender
#eaedfblavender
Secondary
#1f6d93teal
#1f6d93teal
Secondary foreground
#ffffffwhite
#ffffffwhite
Muted
#e2e7e9lavender
#161b1dblack
Muted foreground
#434c51darkslategray
#aeb8bcsilver
Accent
#461f93darkslateblue
#461f93darkslateblue
Accent foreground
#efeafblavender
#efeafblavender
Destructive
#b81e0afirebrick
#f4412aorangered
Destructive foreground
#fef6f5lavenderblush
#ffffffwhite
Border
#e5e7eblavender
#1f2937darkslategray
Input
#e5e7eblavender
#1f2937darkslategray
Ring
#1f3393darkslateblue
#1f3393darkslateblue

Contrast

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

Light mode
Text on background19.77:1AAA
Text on card19.77:1AAA
Primary button9.24:1AAA
Secondary button5.75:1AA
Muted text7.02:1AAA
Accent9.47:1AAA
Destructive6.10:1AA
Dark mode
Text on background20.05:1AAA
Text on card20.05:1AAA
Primary button9.24:1AAA
Secondary button5.75:1AA
Muted text8.60:1AAA
Accent9.47:1AAA
Destructive3.72:1AA Large

CSS variables

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

:root {
  --radius: 0.5rem;
  --background: oklch(0.982 0.004 277.205);
  --foreground: oklch(0.076 0.018 267.288);
  --muted: oklch(0.924 0.007 228.843);
  --muted-foreground: oklch(0.411 0.015 229.288);
  --popover: oklch(0.982 0.004 277.205);
  --popover-foreground: oklch(0.076 0.018 267.288);
  --card: oklch(0.982 0.004 277.205);
  --card-foreground: oklch(0.076 0.018 267.288);
  --border: oklch(0.928 0.006 264.531);
  --input: oklch(0.928 0.006 264.531);
  --primary: oklch(0.373 0.16 268.375);
  --primary-foreground: oklch(0.947 0.019 276.979);
  --secondary: oklch(0.506 0.095 235.404);
  --secondary-foreground: oklch(1 0 180);
  --accent: oklch(0.374 0.174 290.517);
  --accent-foreground: oklch(0.946 0.023 301.104);
  --destructive: oklch(0.504 0.19 30.895);
  --destructive-foreground: oklch(0.98 0.009 26.501);
  --ring: oklch(0.373 0.16 268.375);
  --chart-1: oklch(0.373 0.16 268.375);
  --chart-2: oklch(0.506 0.095 235.404);
  --chart-3: oklch(0.374 0.174 290.517);
  --chart-4: oklch(0.536 0.101 235.515);
  --chart-5: oklch(0.371 0.166 267.898);
}

.dark {
  --radius: 0.5rem;
  --background: oklch(0.102 0.016 271.241);
  --foreground: oklch(0.992 0.001 277.249);
  --muted: oklch(0.217 0.009 229.38);
  --muted-foreground: oklch(0.775 0.013 228.978);
  --popover: oklch(0.102 0.016 271.241);
  --popover-foreground: oklch(0.992 0.001 277.249);
  --card: oklch(0.102 0.016 271.241);
  --card-foreground: oklch(0.992 0.001 277.249);
  --border: oklch(0.278 0.03 256.848);
  --input: oklch(0.278 0.03 256.848);
  --primary: oklch(0.373 0.16 268.375);
  --primary-foreground: oklch(0.947 0.019 276.979);
  --secondary: oklch(0.506 0.095 235.404);
  --secondary-foreground: oklch(1 0 180);
  --accent: oklch(0.374 0.174 290.517);
  --accent-foreground: oklch(0.946 0.023 301.104);
  --destructive: oklch(0.64 0.218 30.986);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.373 0.16 268.375);
  --chart-1: oklch(0.373 0.16 268.375);
  --chart-2: oklch(0.506 0.095 235.404);
  --chart-3: oklch(0.374 0.174 290.517);
  --chart-4: oklch(0.536 0.101 235.515);
  --chart-5: oklch(0.371 0.166 267.898);
}