Metallic for shadcn/ui

Metallic is a shadcn/ui theme built around a deep violet primary color (#301867) with deep green accents (#506718). The light mode uses a neutral background (#ffffff). Dark mode keeps the deep violet primary (#301867) on a neutral background (#000000).

Color palette

TokenLightDark
Background
#ffffffwhite
#000000black
Foreground
#040308black
#ffffffwhite
Card
#ffffffwhite
#000000black
Card foreground
#040308black
#ffffffwhite
Popover
#ffffffwhite
#000000black
Popover foreground
#040308black
#ffffffwhite
Primary
#301867midnightblue
#301867midnightblue
Primary foreground
#cfc1f0thistle
#cfc1f0thistle
Secondary
#506718darkolivegreen
#506718darkolivegreen
Secondary foreground
#ffffffwhite
#ffffffwhite
Muted
#dfe4d3gainsboro
#272c1bdarkslategray
Muted foreground
#636b52dimgray
#a6ad94darkgray
Accent
#506718darkolivegreen
#506718darkolivegreen
Accent foreground
#ffffffwhite
#ffffffwhite
Destructive
#c12c15firebrick
#e6351aorangered
Destructive foreground
#ffffffwhite
#ffffffwhite
Border
#e5e7eblavender
#1f2937darkslategray
Input
#e5e7eblavender
#1f2937darkslategray
Ring
#301867midnightblue
#301867midnightblue

Contrast

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

Light mode
Text on background20.55:1AAA
Text on card20.55:1AAA
Primary button8.61:1AAA
Secondary button6.36:1AA
Muted text4.28:1AA Large
Accent6.36:1AA
Destructive5.77:1AA
Dark mode
Text on background21.00:1AAA
Text on card21.00:1AAA
Primary button8.61:1AAA
Secondary button6.36:1AA
Muted text6.17:1AA
Accent6.36:1AA
Destructive4.31:1AA Large

CSS variables

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

:root {
  --radius: 0.5rem;
  --background: oklch(1 0 180);
  --foreground: oklch(0.101 0.019 300.227);
  --muted: oklch(0.909 0.023 120.457);
  --muted-foreground: oklch(0.513 0.038 121.322);
  --popover: oklch(1 0 180);
  --popover-foreground: oklch(0.101 0.019 300.227);
  --card: oklch(1 0 180);
  --card-foreground: oklch(0.101 0.019 300.227);
  --border: oklch(0.928 0.006 264.531);
  --input: oklch(0.928 0.006 264.531);
  --primary: oklch(0.298 0.129 290);
  --primary-foreground: oklch(0.838 0.067 298.677);
  --secondary: oklch(0.479 0.107 125.035);
  --secondary-foreground: oklch(1 0 180);
  --accent: oklch(0.479 0.107 125.035);
  --accent-foreground: oklch(1 0 180);
  --destructive: oklch(0.531 0.188 31.615);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.298 0.129 290);
  --chart-1: oklch(0.298 0.129 290);
  --chart-2: oklch(0.479 0.107 125.035);
  --chart-3: oklch(0.479 0.107 125.035);
  --chart-4: oklch(0.519 0.117 125.123);
  --chart-5: oklch(0.296 0.134 289.266);
}

.dark {
  --radius: 0.5rem;
  --background: oklch(0 0 0);
  --foreground: oklch(1 0 180);
  --muted: oklch(0.283 0.029 121.859);
  --muted-foreground: oklch(0.735 0.035 120.856);
  --popover: oklch(0 0 0);
  --popover-foreground: oklch(1 0 180);
  --card: oklch(0 0 0);
  --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.298 0.129 290);
  --primary-foreground: oklch(0.838 0.067 298.677);
  --secondary: oklch(0.479 0.107 125.035);
  --secondary-foreground: oklch(1 0 180);
  --accent: oklch(0.479 0.107 125.035);
  --accent-foreground: oklch(1 0 180);
  --destructive: oklch(0.603 0.216 31.587);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.298 0.129 290);
  --chart-1: oklch(0.298 0.129 290);
  --chart-2: oklch(0.479 0.107 125.035);
  --chart-3: oklch(0.479 0.107 125.035);
  --chart-4: oklch(0.519 0.117 125.123);
  --chart-5: oklch(0.296 0.134 289.266);
}