Trim for shadcn/ui

Trim is a shadcn/ui theme built around a blue primary color (#162788) with yellow accents (#887716). The light mode uses a neutral background (#fbfcfe). Dark mode keeps the blue primary (#162788) on a blue-tinted background (#07080d).

Color palette

TokenLightDark
Background
#fbfcfewhite
#07080dblack
Foreground
#020308black
#fcfcfdwhite
Card
#fbfcfewhite
#07080dblack
Card foreground
#020308black
#fcfcfdwhite
Popover
#fbfcfewhite
#07080dblack
Popover foreground
#020308black
#fcfcfdwhite
Primary
#162788midnightblue
#162788midnightblue
Primary foreground
#d8dcf9lavender
#d8dcf9lavender
Secondary
#887716olive
#887716olive
Secondary foreground
#ffffffwhite
#ffffffwhite
Muted
#ece9d4antiquewhite
#2b2713black
Muted foreground
#696654dimgray
#aba896darkgray
Accent
#887716olive
#887716olive
Accent foreground
#ffffffwhite
#ffffffwhite
Destructive
#6f2d06saddlebrown
#e45b0cchocolate
Destructive foreground
#fbc9adpeachpuff
#ffffffwhite
Border
#e5e7eblavender
#1f2937darkslategray
Input
#e5e7eblavender
#1f2937darkslategray
Ring
#162788midnightblue
#162788midnightblue

Contrast

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

Light mode
Text on background20.02:1AAA
Text on card20.02:1AAA
Primary button9.22:1AAA
Secondary button4.47:1AA Large
Muted text4.72:1AA
Accent4.47:1AA Large
Destructive6.84:1AA
Dark mode
Text on background19.51:1AAA
Text on card19.51:1AAA
Primary button9.22:1AAA
Secondary button4.47:1AA Large
Muted text6.26:1AA
Accent4.47:1AA Large
Destructive3.62:1AA Large

CSS variables

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

:root {
  --radius: 0.5rem;
  --background: oklch(0.99 0.003 278.277);
  --foreground: oklch(0.098 0.02 270.387);
  --muted: oklch(0.931 0.027 98.71);
  --muted-foreground: oklch(0.507 0.027 98.997);
  --popover: oklch(0.99 0.003 278.277);
  --popover-foreground: oklch(0.098 0.02 270.387);
  --card: oklch(0.99 0.003 278.277);
  --card-foreground: oklch(0.098 0.02 270.387);
  --border: oklch(0.928 0.006 264.531);
  --input: oklch(0.928 0.006 264.531);
  --primary: oklch(0.337 0.16 267.82);
  --primary-foreground: oklch(0.901 0.039 277.657);
  --secondary: oklch(0.568 0.11 98.343);
  --secondary-foreground: oklch(1 0 180);
  --accent: oklch(0.568 0.11 98.343);
  --accent-foreground: oklch(1 0 180);
  --destructive: oklch(0.385 0.105 44.839);
  --destructive-foreground: oklch(0.873 0.068 51.584);
  --ring: oklch(0.337 0.16 267.82);
  --chart-1: oklch(0.337 0.16 267.82);
  --chart-2: oklch(0.568 0.11 98.343);
  --chart-3: oklch(0.568 0.11 98.343);
  --chart-4: oklch(0.607 0.118 98.289);
  --chart-5: oklch(0.336 0.166 267.346);
}

.dark {
  --radius: 0.5rem;
  --background: oklch(0.136 0.013 275.559);
  --foreground: oklch(0.991 0.002 278.292);
  --muted: oklch(0.271 0.034 99.501);
  --muted-foreground: oklch(0.729 0.025 98.774);
  --popover: oklch(0.136 0.013 275.559);
  --popover-foreground: oklch(0.991 0.002 278.292);
  --card: oklch(0.136 0.013 275.559);
  --card-foreground: oklch(0.991 0.002 278.292);
  --border: oklch(0.278 0.03 256.848);
  --input: oklch(0.278 0.03 256.848);
  --primary: oklch(0.337 0.16 267.82);
  --primary-foreground: oklch(0.901 0.039 277.657);
  --secondary: oklch(0.568 0.11 98.343);
  --secondary-foreground: oklch(1 0 180);
  --accent: oklch(0.568 0.11 98.343);
  --accent-foreground: oklch(1 0 180);
  --destructive: oklch(0.64 0.186 42.981);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.337 0.16 267.82);
  --chart-1: oklch(0.337 0.16 267.82);
  --chart-2: oklch(0.568 0.11 98.343);
  --chart-3: oklch(0.568 0.11 98.343);
  --chart-4: oklch(0.607 0.118 98.289);
  --chart-5: oklch(0.336 0.166 267.346);
}