Masonry for shadcn/ui

Masonry is a shadcn/ui theme built around a purple primary color (#642e70) with green accents (#3a702e). The light mode uses a neutral background (#ffffff). Dark mode keeps the purple primary (#642e70) on a neutral background (#000000).

Color palette

TokenLightDark
Background
#ffffffwhite
#000000black
Foreground
#000000black
#fdfcfdwhite
Card
#fcfcfcsnow
#030303black
Card foreground
#000000black
#ffffffwhite
Popover
#fcfcfcsnow
#030303black
Popover foreground
#000000black
#ffffffwhite
Primary
#642e70rebeccapurple
#642e70rebeccapurple
Primary foreground
#eedef2lavender
#eedef2lavender
Secondary
#3a702edarkolivegreen
#3a702edarkolivegreen
Secondary foreground
#ffffffwhite
#ffffffwhite
Muted
#d4e7cfgainsboro
#1c3018black
Muted foreground
#60635fdimgray
#9da09cdarkgray
Accent
#3a702edarkolivegreen
#3a702edarkolivegreen
Accent foreground
#ffffffwhite
#ffffffwhite
Destructive
#611305maroon
#f54729tomato
Destructive foreground
#faac9elightpink
#ffffffwhite
Border
#e5e7eblavender
#1f2937darkslategray
Input
#e5e7eblavender
#1f2937darkslategray
Ring
#642e70rebeccapurple
#642e70rebeccapurple

Contrast

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

Light mode
Text on background21.00:1AAA
Text on card20.54:1AAA
Primary button7.55:1AAA
Secondary button5.91:1AA
Muted text4.69:1AA
Accent5.91:1AA
Destructive7.14:1AAA
Dark mode
Text on background20.51:1AAA
Text on card20.67:1AAA
Primary button7.55:1AAA
Secondary button5.91:1AA
Muted text5.35:1AA
Accent5.91:1AA
Destructive3.60:1AA Large

CSS variables

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

:root {
  --radius: 0.5rem;
  --background: oklch(1 0 180);
  --foreground: oklch(0 0 0);
  --muted: oklch(0.908 0.039 139.953);
  --muted-foreground: oklch(0.495 0.007 139.978);
  --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.403 0.121 319.973);
  --primary-foreground: oklch(0.92 0.031 320.022);
  --secondary: oklch(0.492 0.114 140.05);
  --secondary-foreground: oklch(1 0 180);
  --accent: oklch(0.492 0.114 140.05);
  --accent-foreground: oklch(1 0 180);
  --destructive: oklch(0.325 0.114 32.575);
  --destructive-foreground: oklch(0.815 0.096 30.335);
  --ring: oklch(0.403 0.121 319.973);
  --chart-1: oklch(0.403 0.121 319.973);
  --chart-2: oklch(0.492 0.114 140.05);
  --chart-3: oklch(0.492 0.114 140.05);
  --chart-4: oklch(0.526 0.123 140.058);
  --chart-5: oklch(0.403 0.129 319.925);
}

.dark {
  --radius: 0.5rem;
  --background: oklch(0 0 0);
  --foreground: oklch(0.992 0.001 319.992);
  --muted: oklch(0.284 0.05 139.929);
  --muted-foreground: oklch(0.702 0.007 139.983);
  --popover: oklch(0.092 0 180);
  --popover-foreground: oklch(1 0 180);
  --card: oklch(0.092 0 180);
  --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.403 0.121 319.973);
  --primary-foreground: oklch(0.92 0.031 320.022);
  --secondary: oklch(0.492 0.114 140.05);
  --secondary-foreground: oklch(1 0 180);
  --accent: oklch(0.492 0.114 140.05);
  --accent-foreground: oklch(1 0 180);
  --destructive: oklch(0.647 0.215 32.364);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.403 0.121 319.973);
  --chart-1: oklch(0.403 0.121 319.973);
  --chart-2: oklch(0.492 0.114 140.05);
  --chart-3: oklch(0.492 0.114 140.05);
  --chart-4: oklch(0.526 0.123 140.058);
  --chart-5: oklch(0.403 0.129 319.925);
}