Canvas for shadcn/ui

Canvas is a shadcn/ui theme built around a blue primary color (#3791cd) with orange accents (#cd7337). The light mode uses a neutral background (#f8fafc). Dark mode keeps the blue primary (#3791cd) on a blue-tinted background (#070b0d).

Color palette

TokenLightDark
Background
#f8fafcghostwhite
#070b0dblack
Foreground
#020608black
#f5f8fawhitesmoke
Card
#f8fafcghostwhite
#070b0dblack
Card foreground
#020608black
#f5f8fawhitesmoke
Popover
#f8fafcghostwhite
#070b0dblack
Popover foreground
#020608black
#f5f8fawhitesmoke
Primary
#3791cdsteelblue
#3791cdsteelblue
Primary foreground
#ffffffwhite
#ffffffwhite
Secondary
#cd7337peru
#cd7337peru
Secondary foreground
#000000black
#000000black
Muted
#f2efedwhitesmoke
#120f0dblack
Muted foreground
#544840darkolivegreen
#bfb3abdarkgray
Accent
#cd7337peru
#cd7337peru
Accent foreground
#000000black
#000000black
Destructive
#6b2405maroon
#f5692etomato
Destructive foreground
#fbc0a7lightpink
#000000black
Border
#e5e7eblavender
#1f2937darkslategray
Input
#e5e7eblavender
#1f2937darkslategray
Ring
#3791cdsteelblue
#3791cdsteelblue

Contrast

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

Light mode
Text on background19.47:1AAA
Text on card19.47:1AAA
Primary button3.44:1AA Large
Secondary button6.10:1AA
Muted text7.72:1AAA
Accent6.10:1AA
Destructive7.02:1AAA
Dark mode
Text on background18.53:1AAA
Text on card18.53:1AAA
Primary button3.44:1AA Large
Secondary button6.10:1AA
Muted text9.33:1AAA
Accent6.10:1AA
Destructive6.96:1AA

CSS variables

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

:root {
  --radius: 0.5rem;
  --background: oklch(0.985 0.004 236.492);
  --foreground: oklch(0.115 0.013 228.862);
  --muted: oklch(0.954 0.004 56.371);
  --muted-foreground: oklch(0.411 0.02 55.759);
  --popover: oklch(0.985 0.004 236.492);
  --popover-foreground: oklch(0.115 0.013 228.862);
  --card: oklch(0.985 0.004 236.492);
  --card-foreground: oklch(0.115 0.013 228.862);
  --border: oklch(0.928 0.006 264.531);
  --input: oklch(0.928 0.006 264.531);
  --primary: oklch(0.63 0.123 241.943);
  --primary-foreground: oklch(1 0 180);
  --secondary: oklch(0.646 0.135 51.581);
  --secondary-foreground: oklch(0 0 0);
  --accent: oklch(0.646 0.135 51.581);
  --accent-foreground: oklch(0 0 0);
  --destructive: oklch(0.364 0.109 40.014);
  --destructive-foreground: oklch(0.855 0.076 44.287);
  --ring: oklch(0.63 0.123 241.943);
  --chart-1: oklch(0.63 0.123 241.943);
  --chart-2: oklch(0.646 0.135 51.581);
  --chart-3: oklch(0.646 0.135 51.581);
  --chart-4: oklch(0.666 0.127 52.447);
  --chart-5: oklch(0.633 0.128 242.365);
}

.dark {
  --radius: 0.5rem;
  --background: oklch(0.145 0.009 235.223);
  --foreground: oklch(0.977 0.004 236.493);
  --muted: oklch(0.17 0.007 55.887);
  --muted-foreground: oklch(0.775 0.017 56.129);
  --popover: oklch(0.145 0.009 235.223);
  --popover-foreground: oklch(0.977 0.004 236.493);
  --card: oklch(0.145 0.009 235.223);
  --card-foreground: oklch(0.977 0.004 236.493);
  --border: oklch(0.278 0.03 256.848);
  --input: oklch(0.278 0.03 256.848);
  --primary: oklch(0.63 0.123 241.943);
  --primary-foreground: oklch(1 0 180);
  --secondary: oklch(0.646 0.135 51.581);
  --secondary-foreground: oklch(0 0 0);
  --accent: oklch(0.646 0.135 51.581);
  --accent-foreground: oklch(0 0 0);
  --destructive: oklch(0.687 0.186 41.277);
  --destructive-foreground: oklch(0 0 0);
  --ring: oklch(0.63 0.123 241.943);
  --chart-1: oklch(0.63 0.123 241.943);
  --chart-2: oklch(0.646 0.135 51.581);
  --chart-3: oklch(0.646 0.135 51.581);
  --chart-4: oklch(0.666 0.127 52.447);
  --chart-5: oklch(0.633 0.128 242.365);
}