Mallard for shadcn/ui

Mallard is a shadcn/ui theme built around a vivid purple primary color (#c81993) with muted light purple accents (#e0d6dd). The light mode uses a neutral background (#ffffff). Dark mode keeps the vivid purple primary (#c81993) on a neutral background (#040203).

Color palette

TokenLightDark
Background
#ffffffwhite
#040203black
Foreground
#000000black
#fdfcfdwhite
Card
#ffffffwhite
#040203black
Card foreground
#000000black
#fdfcfdwhite
Popover
#ffffffwhite
#040203black
Popover foreground
#000000black
#fdfcfdwhite
Primary
#c81993mediumvioletred
#c81993mediumvioletred
Primary foreground
#ffffffwhite
#ffffffwhite
Secondary
#e0d6ddgainsboro
#181617black
Secondary foreground
#4c3946darkslategray
#b2aeb1darkgray
Muted
#e5e0e4gainsboro
#1f1a1dblack
Muted foreground
#616161dimgray
#9e9e9edarkgray
Accent
#e0d6ddgainsboro
#181617black
Accent foreground
#4c3946darkslategray
#b2aeb1darkgray
Destructive
#ce5412chocolate
#d85813chocolate
Destructive foreground
#ffffffwhite
#ffffffwhite
Border
#e5e7eblavender
#1f2937darkslategray
Input
#e5e7eblavender
#1f2937darkslategray
Ring
#c81993mediumvioletred
#c81993mediumvioletred

Contrast

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

Light mode
Text on background21.00:1AAA
Text on card21.00:1AAA
Primary button5.24:1AA
Secondary button7.50:1AAA
Muted text4.77:1AA
Accent7.50:1AAA
Destructive4.27:1AA Large
Dark mode
Text on background20.26:1AAA
Text on card20.26:1AAA
Primary button5.24:1AA
Secondary button8.20:1AAA
Muted text6.43:1AA
Accent8.20:1AAA
Destructive3.95:1AA Large

CSS variables

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

:root {
  --radius: 0.5rem;
  --background: oklch(1 0 180);
  --foreground: oklch(0 0 0);
  --muted: oklch(0.913 0.007 336.017);
  --muted-foreground: oklch(0.492 0 180);
  --popover: oklch(1 0 180);
  --popover-foreground: oklch(0 0 0);
  --card: oklch(1 0 180);
  --card-foreground: oklch(0 0 0);
  --border: oklch(0.928 0.006 264.531);
  --input: oklch(0.928 0.006 264.531);
  --primary: oklch(0.562 0.227 344.773);
  --primary-foreground: oklch(1 0 180);
  --secondary: oklch(0.887 0.014 336.172);
  --secondary-foreground: oklch(0.37 0.033 337.483);
  --accent: oklch(0.887 0.014 336.172);
  --accent-foreground: oklch(0.37 0.033 337.483);
  --destructive: oklch(0.598 0.17 42.966);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.562 0.227 344.773);
  --chart-1: oklch(0.562 0.227 344.773);
  --chart-2: oklch(0.887 0.014 336.172);
  --chart-3: oklch(0.887 0.014 336.172);
  --chart-4: oklch(0.911 0.011 336.099);
  --chart-5: oklch(0.567 0.232 345.098);
}

.dark {
  --radius: 0.5rem;
  --background: oklch(0.087 0.012 336.239);
  --foreground: oklch(0.992 0.002 335.908);
  --muted: oklch(0.223 0.01 336.714);
  --muted-foreground: oklch(0.7 0 180);
  --popover: oklch(0.087 0.012 336.239);
  --popover-foreground: oklch(0.992 0.002 335.908);
  --card: oklch(0.087 0.012 336.239);
  --card-foreground: oklch(0.992 0.002 335.908);
  --border: oklch(0.278 0.03 256.848);
  --input: oklch(0.278 0.03 256.848);
  --primary: oklch(0.562 0.227 344.773);
  --primary-foreground: oklch(1 0 180);
  --secondary: oklch(0.203 0.003 336.132);
  --secondary-foreground: oklch(0.754 0.007 336.045);
  --accent: oklch(0.203 0.003 336.132);
  --accent-foreground: oklch(0.754 0.007 336.045);
  --destructive: oklch(0.618 0.176 42.893);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.562 0.227 344.773);
  --chart-1: oklch(0.562 0.227 344.773);
  --chart-2: oklch(0.203 0.003 336.132);
  --chart-3: oklch(0.203 0.003 336.132);
  --chart-4: oklch(0.236 0.004 336.16);
  --chart-5: oklch(0.567 0.232 345.098);
}