Mallet for shadcn/ui

Mallet is a shadcn/ui theme built around a blue primary color (#687ec4) with violet accents (#8168c4). The light mode uses a neutral background (#fcfcfd). Dark mode keeps the blue primary (#687ec4) on a neutral background (#010204).

Color palette

TokenLightDark
Background
#fcfcfdwhite
#010204black
Foreground
#030816black
#f6f6f9whitesmoke
Card
#fcfcfdwhite
#010204black
Card foreground
#030816black
#f6f6f9whitesmoke
Popover
#fcfcfdwhite
#010204black
Popover foreground
#030816black
#f6f6f9whitesmoke
Primary
#687ec4slateblue
#687ec4slateblue
Primary foreground
#000000black
#000000black
Secondary
#68acc4cadetblue
#68acc4cadetblue
Secondary foreground
#000000black
#000000black
Muted
#d1dce0gainsboro
#1f2a2edarkslategray
Muted foreground
#495255darkslategray
#aab3b6darkgray
Accent
#8168c4slateblue
#8168c4slateblue
Accent foreground
#ffffffwhite
#ffffffwhite
Destructive
#be490echocolate
#da5410chocolate
Destructive foreground
#ffffffwhite
#ffffffwhite
Border
#e5e7eblavender
#1f2937darkslategray
Input
#e5e7eblavender
#1f2937darkslategray
Ring
#687ec4slateblue
#687ec4slateblue

Contrast

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

Light mode
Text on background19.49:1AAA
Text on card19.49:1AAA
Primary button5.37:1AA
Secondary button8.28:1AAA
Muted text5.74:1AA
Accent4.43:1AA Large
Destructive5.07:1AA
Dark mode
Text on background19.23:1AAA
Text on card19.23:1AAA
Primary button5.37:1AA
Secondary button8.28:1AAA
Muted text6.90:1AA
Accent4.43:1AA Large
Destructive3.99:1AA Large

CSS variables

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

:root {
  --radius: 0.5rem;
  --background: oklch(0.991 0.002 272.639);
  --foreground: oklch(0.136 0.035 264.145);
  --muted: oklch(0.888 0.013 221.443);
  --muted-foreground: oklch(0.432 0.013 221.616);
  --popover: oklch(0.991 0.002 272.639);
  --popover-foreground: oklch(0.136 0.035 264.145);
  --card: oklch(0.991 0.002 272.639);
  --card-foreground: oklch(0.136 0.035 264.145);
  --border: oklch(0.928 0.006 264.531);
  --input: oklch(0.928 0.006 264.531);
  --primary: oklch(0.607 0.11 270.035);
  --primary-foreground: oklch(0 0 0);
  --secondary: oklch(0.708 0.077 223.343);
  --secondary-foreground: oklch(0 0 0);
  --accent: oklch(0.584 0.138 293.977);
  --accent-foreground: oklch(1 0 180);
  --destructive: oklch(0.556 0.163 41.557);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.607 0.11 270.035);
  --chart-1: oklch(0.607 0.11 270.035);
  --chart-2: oklch(0.708 0.077 223.343);
  --chart-3: oklch(0.584 0.138 293.977);
  --chart-4: oklch(0.729 0.072 223.004);
  --chart-5: oklch(0.603 0.118 269.796);
}

.dark {
  --radius: 0.5rem;
  --background: oklch(0.085 0.009 267.583);
  --foreground: oklch(0.975 0.004 272.618);
  --muted: oklch(0.276 0.017 222.115);
  --muted-foreground: oklch(0.76 0.011 221.444);
  --popover: oklch(0.085 0.009 267.583);
  --popover-foreground: oklch(0.975 0.004 272.618);
  --card: oklch(0.085 0.009 267.583);
  --card-foreground: oklch(0.975 0.004 272.618);
  --border: oklch(0.278 0.03 256.848);
  --input: oklch(0.278 0.03 256.848);
  --primary: oklch(0.607 0.11 270.035);
  --primary-foreground: oklch(0 0 0);
  --secondary: oklch(0.708 0.077 223.343);
  --secondary-foreground: oklch(0 0 0);
  --accent: oklch(0.584 0.138 293.977);
  --accent-foreground: oklch(1 0 180);
  --destructive: oklch(0.616 0.182 41.324);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.607 0.11 270.035);
  --chart-1: oklch(0.607 0.11 270.035);
  --chart-2: oklch(0.708 0.077 223.343);
  --chart-3: oklch(0.584 0.138 293.977);
  --chart-4: oklch(0.729 0.072 223.004);
  --chart-5: oklch(0.603 0.118 269.796);
}