Scholar for shadcn/ui

Scholar is a shadcn/ui theme built around a deep green primary color (#2e471a) with deep violet accents (#331a47). The light mode uses a neutral background (#ffffff). Dark mode keeps the deep green primary (#2e471a) on a green-tinted background (#070c03).

Color palette

TokenLightDark
Background
#ffffffwhite
#070c03black
Foreground
#020401black
#fafbf8snow
Card
#ffffffwhite
#070c03black
Card foreground
#020401black
#fafbf8snow
Popover
#ffffffwhite
#070c03black
Popover foreground
#020401black
#fafbf8snow
Primary
#2e471adarkslategray
#2e471adarkslategray
Primary foreground
#c7e2b1silver
#c7e2b1silver
Secondary
#331a47midnightblue
#331a47midnightblue
Secondary foreground
#ccb1e2thistle
#ccb1e2thistle
Muted
#e3e1e5gainsboro
#1c1a1eblack
Muted foreground
#403f40darkslategray
#bfbfc0silver
Accent
#331a47midnightblue
#331a47midnightblue
Accent foreground
#ccb1e2thistle
#ccb1e2thistle
Destructive
#73160cmaroon
#e9422ftomato
Destructive foreground
#f8c0balightpink
#ffffffwhite
Border
#e5e7eblavender
#1f2937darkslategray
Input
#e5e7eblavender
#1f2937darkslategray
Ring
#2e471adarkslategray
#2e471adarkslategray

Contrast

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

Light mode
Text on background20.58:1AAA
Text on card20.58:1AAA
Primary button7.37:1AAA
Secondary button7.94:1AAA
Muted text8.05:1AAA
Accent7.94:1AAA
Destructive7.12:1AAA
Dark mode
Text on background19.02:1AAA
Text on card19.02:1AAA
Primary button7.37:1AAA
Secondary button7.94:1AAA
Muted text9.40:1AAA
Accent7.94:1AAA
Destructive3.96:1AA Large

CSS variables

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

:root {
  --radius: 0.5rem;
  --background: oklch(1 0 180);
  --foreground: oklch(0.1 0.016 129.093);
  --muted: oklch(0.912 0.007 310.37);
  --muted-foreground: oklch(0.369 0.002 310.379);
  --popover: oklch(1 0 180);
  --popover-foreground: oklch(0.1 0.016 129.093);
  --card: oklch(1 0 180);
  --card-foreground: oklch(0.1 0.016 129.093);
  --border: oklch(0.928 0.006 264.531);
  --input: oklch(0.928 0.006 264.531);
  --primary: oklch(0.365 0.076 132.996);
  --primary-foreground: oklch(0.88 0.072 131.244);
  --secondary: oklch(0.276 0.083 307.212);
  --secondary-foreground: oklch(0.799 0.074 309.573);
  --accent: oklch(0.276 0.083 307.212);
  --accent-foreground: oklch(0.799 0.074 309.573);
  --destructive: oklch(0.365 0.129 30.423);
  --destructive-foreground: oklch(0.856 0.065 25.791);
  --ring: oklch(0.365 0.076 132.996);
  --chart-1: oklch(0.365 0.076 132.996);
  --chart-2: oklch(0.276 0.083 307.212);
  --chart-3: oklch(0.276 0.083 307.212);
  --chart-4: oklch(0.302 0.093 307.076);
  --chart-5: oklch(0.369 0.08 133.174);
}

.dark {
  --radius: 0.5rem;
  --background: oklch(0.145 0.023 129.333);
  --foreground: oklch(0.987 0.004 130.477);
  --muted: oklch(0.222 0.009 310.046);
  --muted-foreground: oklch(0.804 0.002 310.415);
  --popover: oklch(0.145 0.023 129.333);
  --popover-foreground: oklch(0.987 0.004 130.477);
  --card: oklch(0.145 0.023 129.333);
  --card-foreground: oklch(0.987 0.004 130.477);
  --border: oklch(0.278 0.03 256.848);
  --input: oklch(0.278 0.03 256.848);
  --primary: oklch(0.365 0.076 132.996);
  --primary-foreground: oklch(0.88 0.072 131.244);
  --secondary: oklch(0.276 0.083 307.212);
  --secondary-foreground: oklch(0.799 0.074 309.573);
  --accent: oklch(0.276 0.083 307.212);
  --accent-foreground: oklch(0.799 0.074 309.573);
  --destructive: oklch(0.623 0.207 30.174);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.365 0.076 132.996);
  --chart-1: oklch(0.365 0.076 132.996);
  --chart-2: oklch(0.276 0.083 307.212);
  --chart-3: oklch(0.276 0.083 307.212);
  --chart-4: oklch(0.302 0.093 307.076);
  --chart-5: oklch(0.369 0.08 133.174);
}