Subtitle for shadcn/ui

Subtitle is a shadcn/ui theme built around a violet primary color (#8043a3) with teal accents (#43a380). The light mode uses a neutral background (#fdfcfd). Dark mode keeps the violet primary (#8043a3) on a neutral background (#000000).

Color palette

TokenLightDark
Background
#fdfcfdwhite
#000000black
Foreground
#0c0311black
#ffffffwhite
Card
#faf8fbghostwhite
#030303black
Card foreground
#09020dblack
#ffffffwhite
Popover
#fdfcfdwhite
#000000black
Popover foreground
#0c0311black
#ffffffwhite
Primary
#8043a3rebeccapurple
#8043a3rebeccapurple
Primary foreground
#ffffffwhite
#ffffffwhite
Secondary
#a38043peru
#a38043peru
Secondary foreground
#000000black
#000000black
Muted
#e8e1d4gainsboro
#2b2417black
Muted foreground
#514e48darkslategray
#b7b4aedarkgray
Accent
#43a380mediumseagreen
#43a380mediumseagreen
Accent foreground
#07120eblack
#07120eblack
Destructive
#ca0f02firebrick
#fd2b1corangered
Destructive foreground
#ffffffwhite
#ffffffwhite
Border
#e5e7eblavender
#1f2937darkslategray
Input
#e5e7eblavender
#1f2937darkslategray
Ring
#8043a3rebeccapurple
#8043a3rebeccapurple

Contrast

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

Light mode
Text on background19.74:1AAA
Text on card19.43:1AAA
Primary button6.49:1AA
Secondary button5.70:1AA
Muted text6.35:1AA
Accent6.15:1AA
Destructive5.86:1AA
Dark mode
Text on background21.00:1AAA
Text on card20.67:1AAA
Primary button6.49:1AA
Secondary button5.70:1AA
Muted text7.42:1AAA
Accent6.15:1AA
Destructive3.80:1AA Large

CSS variables

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

:root {
  --radius: 0.5rem;
  --background: oklch(0.991 0.002 313.591);
  --foreground: oklch(0.128 0.038 313.912);
  --muted: oklch(0.911 0.019 81.494);
  --muted-foreground: oklch(0.424 0.01 81.486);
  --popover: oklch(0.991 0.002 313.591);
  --popover-foreground: oklch(0.128 0.038 313.912);
  --card: oklch(0.982 0.005 313.576);
  --card-foreground: oklch(0.116 0.033 315.47);
  --border: oklch(0.928 0.006 264.531);
  --input: oklch(0.928 0.006 264.531);
  --primary: oklch(0.5 0.156 311.249);
  --primary-foreground: oklch(1 0 180);
  --secondary: oklch(0.62 0.09 79.496);
  --secondary-foreground: oklch(0 0 0);
  --accent: oklch(0.648 0.106 165.984);
  --accent-foreground: oklch(0.171 0.018 169.401);
  --destructive: oklch(0.531 0.212 29.883);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.5 0.156 311.249);
  --chart-1: oklch(0.5 0.156 311.249);
  --chart-2: oklch(0.62 0.09 79.496);
  --chart-3: oklch(0.648 0.106 165.984);
  --chart-4: oklch(0.649 0.095 79.465);
  --chart-5: oklch(0.498 0.166 311.009);
}

.dark {
  --radius: 0.5rem;
  --background: oklch(0 0 0);
  --foreground: oklch(1 0 180);
  --muted: oklch(0.264 0.025 80.897);
  --muted-foreground: oklch(0.77 0.009 81.508);
  --popover: oklch(0 0 0);
  --popover-foreground: oklch(1 0 180);
  --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.5 0.156 311.249);
  --primary-foreground: oklch(1 0 180);
  --secondary: oklch(0.62 0.09 79.496);
  --secondary-foreground: oklch(0 0 0);
  --accent: oklch(0.648 0.106 165.984);
  --accent-foreground: oklch(0.171 0.018 169.401);
  --destructive: oklch(0.638 0.242 29.64);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.5 0.156 311.249);
  --chart-1: oklch(0.5 0.156 311.249);
  --chart-2: oklch(0.62 0.09 79.496);
  --chart-3: oklch(0.648 0.106 165.984);
  --chart-4: oklch(0.649 0.095 79.465);
  --chart-5: oklch(0.498 0.166 311.009);
}