Dimension for shadcn/ui

Dimension is a shadcn/ui theme built around a blue primary color (#4d6fcb) with indigo accents (#6b4dcb). The light mode uses a neutral background (#fbfcfd). Dark mode keeps the blue primary (#4d6fcb) on a neutral background (#020408).

Color palette

TokenLightDark
Background
#fbfcfdwhite
#020408black
Foreground
#020309black
#fcfcfdwhite
Card
#fbfcfdwhite
#020408black
Card foreground
#020309black
#fcfcfdwhite
Popover
#fbfcfdwhite
#020408black
Popover foreground
#020309black
#fcfcfdwhite
Primary
#4d6fcbroyalblue
#4d6fcbroyalblue
Primary foreground
#ffffffwhite
#ffffffwhite
Secondary
#4daecbmediumturquoise
#4daecbmediumturquoise
Secondary foreground
#000000black
#000000black
Muted
#d7e2e5gainsboro
#1a2528black
Muted foreground
#47575cdarkslategray
#a3b3b8darkgray
Accent
#6b4dcbslateblue
#6b4dcbslateblue
Accent foreground
#ffffffwhite
#ffffffwhite
Destructive
#8d2607saddlebrown
#f4420borangered
Destructive foreground
#fcd5c9bisque
#ffffffwhite
Border
#e5e7eblavender
#1f2937darkslategray
Input
#e5e7eblavender
#1f2937darkslategray
Ring
#4d6fcbroyalblue
#4d6fcbroyalblue

Contrast

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

Light mode
Text on background20.07:1AAA
Text on card20.07:1AAA
Primary button4.72:1AA
Secondary button8.22:1AAA
Muted text5.69:1AA
Accent5.91:1AA
Destructive6.41:1AA
Dark mode
Text on background20.02:1AAA
Text on card20.02:1AAA
Primary button4.72:1AA
Secondary button8.22:1AAA
Muted text7.23:1AAA
Accent5.91:1AA
Destructive3.74:1AA Large

CSS variables

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

:root {
  --radius: 0.5rem;
  --background: oklch(0.991 0.002 270.104);
  --foreground: oklch(0.101 0.019 259.961);
  --muted: oklch(0.905 0.013 217.832);
  --muted-foreground: oklch(0.446 0.022 218.175);
  --popover: oklch(0.991 0.002 270.104);
  --popover-foreground: oklch(0.101 0.019 259.961);
  --card: oklch(0.991 0.002 270.104);
  --card-foreground: oklch(0.101 0.019 259.961);
  --border: oklch(0.928 0.006 264.531);
  --input: oklch(0.928 0.006 264.531);
  --primary: oklch(0.562 0.148 266.64);
  --primary-foreground: oklch(1 0 180);
  --secondary: oklch(0.704 0.1 220.974);
  --secondary-foreground: oklch(0 0 0);
  --accent: oklch(0.522 0.186 289.014);
  --accent-foreground: oklch(1 0 180);
  --destructive: oklch(0.43 0.143 35.49);
  --destructive-foreground: oklch(0.904 0.047 37.597);
  --ring: oklch(0.562 0.148 266.64);
  --chart-1: oklch(0.562 0.148 266.64);
  --chart-2: oklch(0.704 0.1 220.974);
  --chart-3: oklch(0.522 0.186 289.014);
  --chart-4: oklch(0.723 0.095 220.401);
  --chart-5: oklch(0.56 0.156 266.406);
}

.dark {
  --radius: 0.5rem;
  --background: oklch(0.105 0.015 262.558);
  --foreground: oklch(0.991 0.002 270.105);
  --muted: oklch(0.256 0.017 218.435);
  --muted-foreground: oklch(0.756 0.019 217.924);
  --popover: oklch(0.105 0.015 262.558);
  --popover-foreground: oklch(0.991 0.002 270.105);
  --card: oklch(0.105 0.015 262.558);
  --card-foreground: oklch(0.991 0.002 270.105);
  --border: oklch(0.278 0.03 256.848);
  --input: oklch(0.278 0.03 256.848);
  --primary: oklch(0.562 0.148 266.64);
  --primary-foreground: oklch(1 0 180);
  --secondary: oklch(0.704 0.1 220.974);
  --secondary-foreground: oklch(0 0 0);
  --accent: oklch(0.522 0.186 289.014);
  --accent-foreground: oklch(1 0 180);
  --destructive: oklch(0.638 0.221 34.741);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.562 0.148 266.64);
  --chart-1: oklch(0.562 0.148 266.64);
  --chart-2: oklch(0.704 0.1 220.974);
  --chart-3: oklch(0.522 0.186 289.014);
  --chart-4: oklch(0.723 0.095 220.401);
  --chart-5: oklch(0.56 0.156 266.406);
}