Commerce for shadcn/ui

Commerce is a shadcn/ui theme built around a blue primary color (#4775a9) with indigo accents (#4a47a9). The light mode uses a neutral background (#ffffff). Dark mode keeps the blue primary (#4775a9) on a neutral background (#000000).

Color palette

TokenLightDark
Background
#ffffffwhite
#000000black
Foreground
#010204black
#f9fafbghostwhite
Card
#fcfcfcsnow
#030303black
Card foreground
#000000black
#fcfcfdwhite
Popover
#fcfcfcsnow
#030303black
Popover foreground
#000000black
#fcfcfdwhite
Primary
#4775a9steelblue
#4775a9steelblue
Primary foreground
#ffffffwhite
#ffffffwhite
Secondary
#47a6a9cadetblue
#47a6a9cadetblue
Secondary foreground
#0b1919black
#0b1919black
Muted
#e8f2f2whitesmoke
#0d1617black
Muted foreground
#545959dimgray
#a6ababdarkgray
Accent
#4a47a9darkslateblue
#4a47a9darkslateblue
Accent foreground
#ffffffwhite
#ffffffwhite
Destructive
#a23a07saddlebrown
#f66923chocolate
Destructive foreground
#ffffffwhite
#000000black
Border
#e5e7eblavender
#1f2937darkslategray
Input
#e5e7eblavender
#1f2937darkslategray
Ring
#4775a9steelblue
#4775a9steelblue

Contrast

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

Light mode
Text on background20.75:1AAA
Text on card20.54:1AAA
Primary button4.81:1AA
Secondary button6.22:1AA
Muted text6.23:1AA
Accent7.61:1AAA
Destructive6.68:1AA
Dark mode
Text on background20.09:1AAA
Text on card20.16:1AAA
Primary button4.81:1AA
Secondary button6.22:1AA
Muted text7.87:1AAA
Accent7.61:1AAA
Destructive6.95:1AA

CSS variables

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

:root {
  --radius: 0.5rem;
  --background: oklch(1 0 180);
  --foreground: oklch(0.088 0.009 243.814);
  --muted: oklch(0.953 0.01 199.465);
  --muted-foreground: oklch(0.46 0.006 199.418);
  --popover: oklch(0.992 0 161.565);
  --popover-foreground: oklch(0 0 0);
  --card: oklch(0.992 0 161.565);
  --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.551 0.097 252.833);
  --primary-foreground: oklch(1 0 180);
  --secondary: oklch(0.669 0.089 198.369);
  --secondary-foreground: oklch(0.199 0.02 198.524);
  --accent: oklch(0.457 0.153 279.935);
  --accent-foreground: oklch(1 0 180);
  --destructive: oklch(0.49 0.147 40.968);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.551 0.097 252.833);
  --chart-1: oklch(0.551 0.097 252.833);
  --chart-2: oklch(0.669 0.089 198.369);
  --chart-3: oklch(0.457 0.153 279.935);
  --chart-4: oklch(0.7 0.093 198.369);
  --chart-5: oklch(0.551 0.103 252.983);
}

.dark {
  --radius: 0.5rem;
  --background: oklch(0 0 0);
  --foreground: oklch(0.984 0.002 251.47);
  --muted: oklch(0.193 0.014 198.757);
  --muted-foreground: oklch(0.736 0.006 199.5);
  --popover: oklch(0.092 0 180);
  --popover-foreground: oklch(0.992 0.001 251.46);
  --card: oklch(0.092 0 180);
  --card-foreground: oklch(0.992 0.001 251.46);
  --border: oklch(0.278 0.03 256.848);
  --input: oklch(0.278 0.03 256.848);
  --primary: oklch(0.551 0.097 252.833);
  --primary-foreground: oklch(1 0 180);
  --secondary: oklch(0.669 0.089 198.369);
  --secondary-foreground: oklch(0.199 0.02 198.524);
  --accent: oklch(0.457 0.153 279.935);
  --accent-foreground: oklch(1 0 180);
  --destructive: oklch(0.687 0.189 42.876);
  --destructive-foreground: oklch(0 0 0);
  --ring: oklch(0.551 0.097 252.833);
  --chart-1: oklch(0.551 0.097 252.833);
  --chart-2: oklch(0.669 0.089 198.369);
  --chart-3: oklch(0.457 0.153 279.935);
  --chart-4: oklch(0.7 0.093 198.369);
  --chart-5: oklch(0.551 0.103 252.983);
}