Constant for shadcn/ui

Constant is a shadcn/ui theme built around a light indigo primary color (#b4abd9) with light violet accents (#cbabd9). The light mode uses a neutral background (#f8f7fd). Dark mode keeps the light indigo primary (#b4abd9) on a neutral background (#020104).

Color palette

TokenLightDark
Background
#f8f7fdghostwhite
#020104black
Foreground
#05030cblack
#f9f9fbghostwhite
Card
#f5f3fbwhitesmoke
#040307black
Card foreground
#030208black
#fcfcfdwhite
Popover
#f8f7fdghostwhite
#020104black
Popover foreground
#05030cblack
#f9f9fbghostwhite
Primary
#b4abd9lightsteelblue
#b4abd9lightsteelblue
Primary foreground
#1f1938midnightblue
#1f1938midnightblue
Secondary
#abb8d9lightsteelblue
#abb8d9lightsteelblue
Secondary foreground
#192338darkslategray
#192338darkslategray
Muted
#eef1f6whitesmoke
#090b11black
Muted foreground
#4e525adarkslategray
#a5a8b1darkgray
Accent
#cbabd9plum
#cbabd9plum
Accent foreground
#2f1938darkslategray
#2f1938darkslategray
Destructive
#d03f01orangered
#fe5f1borangered
Destructive foreground
#ffffffwhite
#000000black
Border
#e5e7eblavender
#1f2937darkslategray
Input
#e5e7eblavender
#1f2937darkslategray
Ring
#b4abd9lightsteelblue
#b4abd9lightsteelblue

Contrast

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

Light mode
Text on background19.25:1AAA
Text on card18.82:1AAA
Primary button7.75:1AAA
Secondary button7.93:1AAA
Muted text6.91:1AA
Accent7.84:1AAA
Destructive4.77:1AA
Dark mode
Text on background19.77:1AAA
Text on card20.08:1AAA
Primary button7.75:1AAA
Secondary button7.93:1AAA
Muted text8.27:1AAA
Accent7.84:1AAA
Destructive6.85:1AA

CSS variables

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

:root {
  --radius: 0.5rem;
  --background: oklch(0.979 0.007 295.44);
  --foreground: oklch(0.11 0.027 294.215);
  --muted: oklch(0.957 0.008 267.373);
  --muted-foreground: oklch(0.438 0.014 267.201);
  --popover: oklch(0.979 0.007 295.44);
  --popover-foreground: oklch(0.11 0.027 294.215);
  --card: oklch(0.968 0.011 295.368);
  --card-foreground: oklch(0.096 0.023 294.426);
  --border: oklch(0.928 0.006 264.531);
  --input: oklch(0.928 0.006 264.531);
  --primary: oklch(0.763 0.067 293.935);
  --primary-foreground: oklch(0.24 0.058 290.555);
  --secondary: oklch(0.784 0.049 266.944);
  --secondary-foreground: oklch(0.257 0.043 265.785);
  --accent: oklch(0.784 0.074 315.684);
  --accent-foreground: oklch(0.259 0.062 315.017);
  --destructive: oklch(0.575 0.19 37.43);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.763 0.067 293.935);
  --chart-1: oklch(0.763 0.067 293.935);
  --chart-2: oklch(0.784 0.049 266.944);
  --chart-3: oklch(0.784 0.074 315.684);
  --chart-4: oklch(0.812 0.042 267.037);
  --chart-5: oklch(0.76 0.072 293.788);
}

.dark {
  --radius: 0.5rem;
  --background: oklch(0.08 0.014 294.789);
  --foreground: oklch(0.983 0.002 295.538);
  --muted: oklch(0.151 0.012 266.52);
  --muted-foreground: oklch(0.733 0.013 267.314);
  --popover: oklch(0.08 0.014 294.789);
  --popover-foreground: oklch(0.983 0.002 295.538);
  --card: oklch(0.101 0.017 294.789);
  --card-foreground: oklch(0.992 0.001 295.558);
  --border: oklch(0.278 0.03 256.848);
  --input: oklch(0.278 0.03 256.848);
  --primary: oklch(0.763 0.067 293.935);
  --primary-foreground: oklch(0.24 0.058 290.555);
  --secondary: oklch(0.784 0.049 266.944);
  --secondary-foreground: oklch(0.257 0.043 265.785);
  --accent: oklch(0.784 0.074 315.684);
  --accent-foreground: oklch(0.259 0.062 315.017);
  --destructive: oklch(0.686 0.206 39.634);
  --destructive-foreground: oklch(0 0 0);
  --ring: oklch(0.763 0.067 293.935);
  --chart-1: oklch(0.763 0.067 293.935);
  --chart-2: oklch(0.784 0.049 266.944);
  --chart-3: oklch(0.784 0.074 315.684);
  --chart-4: oklch(0.812 0.042 267.037);
  --chart-5: oklch(0.76 0.072 293.788);
}