Contrary for shadcn/ui

Contrary is a shadcn/ui theme built around a vivid light indigo primary color (#cbc8f9) with muted light indigo accents (#e2e1ea). The light mode uses a neutral background (#ffffff). Dark mode keeps the vivid light indigo primary (#cbc8f9) on a neutral background (#020104).

Color palette

TokenLightDark
Background
#ffffffwhite
#020104black
Foreground
#010105black
#ffffffwhite
Card
#fcfcfcsnow
#030307black
Card foreground
#000000black
#ffffffwhite
Popover
#fcfcfcsnow
#030307black
Popover foreground
#000000black
#ffffffwhite
Primary
#cbc8f9thistle
#cbc8f9thistle
Primary foreground
#160e81midnightblue
#160e81midnightblue
Secondary
#e2e1eagainsboro
#2b293ddarkslategray
Secondary foreground
#424059darkslategray
#c4c2d6thistle
Muted
#e2e1eflavender
#11101eblack
Muted foreground
#49485bdarkslategray
#a5a4b7darkgray
Accent
#e2e1eagainsboro
#2b293ddarkslategray
Accent foreground
#424059darkslategray
#c4c2d6thistle
Destructive
#770f0dmaroon
#e6211ecrimson
Destructive foreground
#f8c0bflightpink
#ffffffwhite
Border
#e5e7eblavender
#1f2937darkslategray
Input
#e5e7eblavender
#1f2937darkslategray
Ring
#cbc8f9thistle
#cbc8f9thistle

Contrast

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

Light mode
Text on background20.83:1AAA
Text on card20.54:1AAA
Primary button9.31:1AAA
Secondary button7.69:1AAA
Muted text6.87:1AA
Accent7.69:1AAA
Destructive7.12:1AAA
Dark mode
Text on background20.79:1AAA
Text on card20.59:1AAA
Primary button9.31:1AAA
Secondary button8.08:1AAA
Muted text7.70:1AAA
Accent8.08:1AAA
Destructive4.55:1AA

CSS variables

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

:root {
  --radius: 0.5rem;
  --background: oklch(1 0 180);
  --foreground: oklch(0.068 0.024 283.377);
  --muted: oklch(0.914 0.019 289.081);
  --muted-foreground: oklch(0.41 0.033 287.926);
  --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.851 0.068 287.921);
  --primary-foreground: oklch(0.293 0.174 270.799);
  --secondary: oklch(0.914 0.011 289.252);
  --secondary-foreground: oklch(0.384 0.041 287.336);
  --accent: oklch(0.914 0.011 289.252);
  --accent-foreground: oklch(0.384 0.041 287.336);
  --destructive: oklch(0.367 0.138 28);
  --destructive-foreground: oklch(0.857 0.065 19.624);
  --ring: oklch(0.851 0.068 287.921);
  --chart-1: oklch(0.851 0.068 287.921);
  --chart-2: oklch(0.914 0.011 289.252);
  --chart-3: oklch(0.914 0.011 289.252);
  --chart-4: oklch(0.94 0.008 289.326);
  --chart-5: oklch(0.849 0.07 287.855);
}

.dark {
  --radius: 0.5rem;
  --background: oklch(0.08 0.013 287.061);
  --foreground: oklch(1 0 180);
  --muted: oklch(0.181 0.029 286.182);
  --muted-foreground: oklch(0.725 0.028 288.738);
  --popover: oklch(0.1 0.017 287.061);
  --popover-foreground: oklch(1 0 180);
  --card: oklch(0.1 0.017 287.061);
  --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.851 0.068 287.921);
  --primary-foreground: oklch(0.293 0.174 270.799);
  --secondary: oklch(0.292 0.035 287.072);
  --secondary-foreground: oklch(0.822 0.027 288.855);
  --accent: oklch(0.292 0.035 287.072);
  --accent-foreground: oklch(0.822 0.027 288.855);
  --destructive: oklch(0.592 0.227 28.325);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.851 0.068 287.921);
  --chart-1: oklch(0.851 0.068 287.921);
  --chart-2: oklch(0.292 0.035 287.072);
  --chart-3: oklch(0.292 0.035 287.072);
  --chart-4: oklch(0.319 0.039 286.988);
  --chart-5: oklch(0.849 0.07 287.855);
}