Skip to content

Moss, a shadcn/ui preset

Olive green on a sage grey, softer corners, Figtree.

Fonts: Figtree · radius 0.75rem · light and dark · lowest text contrast 4.77:1

npx shadcn@latest add https://www.themes.dev/r/presets/moss.json
Edit in the generator

Moss on six free blocks from themes.dev UI. Scroll inside the preview.

The colours

The main variables, light and dark. The full set of 31 per mode, sidebar and charts included, is in the CSS below.

Light

  • background#ffffff
  • foreground#080b08
  • primary#3f6212
  • primary-foreground#ffffff
  • secondary#f0f6f1
  • muted-foreground#696d69
  • accent#edf8e4
  • border#e2e7e2
  • destructive#e7000a
  • ring#3f6212
  • chart-1#a7d082
  • chart-2#7c9f5a
  • chart-3#618042
  • chart-4#4a652f
  • chart-5#364d1e

Dark

  • background#0b0e0b
  • foreground#f9faf9
  • primary#98c072
  • primary-foreground#0f1310
  • secondary#242724
  • muted-foreground#b4b9b5
  • accent#27321c
  • border#292c29
  • destructive#ff9693
  • ring#98c072
  • chart-1#aad385
  • chart-2#88ac66
  • chart-3#6c8c4e
  • chart-4#526d37
  • chart-5#3e5626

Contrast, checked

Every pair shadcn/ui draws text with, measured as WCAG 2 contrast (AA needs 4.5:1) and APCA Lc (we ask 60 for text). Focus rings need 3:1 on the page.

WherePairLightDark
Body textforeground on background19.77:1 · Lc 10618.58:1 · Lc 104
Secondary text on the pagemuted-foreground on background5.26:1 · Lc 769.72:1 · Lc 63
Text in cardscard-foreground on card19.77:1 · Lc 10617.13:1 · Lc 104
Secondary text in cardsmuted-foreground on card5.26:1 · Lc 768.96:1 · Lc 63
Menus and popoverspopover-foreground on popover19.77:1 · Lc 10617.13:1 · Lc 104
Primary buttonsprimary-foreground on primary7.07:1 · Lc 899.04:1 · Lc 63
Links and outline accentsprimary on background7.07:1 · Lc 849.33:1 · Lc 61
Secondary buttonssecondary-foreground on secondary16.29:1 · Lc 9814.45:1 · Lc 101
Text on muted panelsmuted-foreground on muted4.79:1 · Lc 707.55:1 · Lc 61
Hovered menu itemsaccent-foreground on accent9.53:1 · Lc 8812.91:1 · Lc 100
Error messagesdestructive on background4.77:1 · Lc 709.25:1 · Lc 61
Sidebarsidebar-foreground on sidebar18.99:1 · Lc 10317.13:1 · Lc 104
Sidebar active itemsidebar-primary-foreground on sidebar-primary7.07:1 · Lc 899.04:1 · Lc 63
Sidebar hoversidebar-accent-foreground on sidebar-accent16.29:1 · Lc 9814.45:1 · Lc 101
Focus ringring on background7.07:19.33:1

Use it

With the shadcn CLI, in a project set up with shadcn init:

npx shadcn@latest add https://www.themes.dev/r/presets/moss.json

Or paste the CSS into globals.css (Next.js) or your main stylesheet (Vite, Astro), replacing the :root and .dark values that are there.

Then load the font:

npm i @fontsource-variable/figtree

The registry item: themes.dev/r/presets/moss.json. Free to use in any project.

globals.css
:root {
  --radius: 0.75rem;
  --background: oklch(1 0 0);
  --foreground: oklch(0.145 0.008 150);
  --card: oklch(1 0 0);
  --card-foreground: oklch(0.145 0.008 150);
  --popover: oklch(1 0 0);
  --popover-foreground: oklch(0.145 0.008 150);
  --primary: oklch(0.453 0.113 130.93);
  --primary-foreground: oklch(1 0 0);
  --secondary: oklch(0.967 0.008 150);
  --secondary-foreground: oklch(0.205 0.008 150);
  --muted: oklch(0.967 0.008 150);
  --muted-foreground: oklch(0.53 0.008 150);
  --accent: oklch(0.965 0.028 130.93);
  --accent-foreground: oklch(0.361 0.102 132.94);
  --destructive: oklch(0.583 0.239 28.5);
  --border: oklch(0.922 0.008 150);
  --input: oklch(0.87 0.008 150);
  --ring: oklch(0.453 0.113 130.93);
  --chart-1: oklch(0.81 0.113 130.93);
  --chart-2: oklch(0.66 0.104 130.93);
  --chart-3: oklch(0.56 0.095 130.93);
  --chart-4: oklch(0.47 0.086 130.93);
  --chart-5: oklch(0.39 0.077 130.93);
  --sidebar: oklch(0.985 0.008 150);
  --sidebar-foreground: oklch(0.145 0.008 150);
  --sidebar-primary: oklch(0.453 0.113 130.93);
  --sidebar-primary-foreground: oklch(1 0 0);
  --sidebar-accent: oklch(0.967 0.008 150);
  --sidebar-accent-foreground: oklch(0.205 0.008 150);
  --sidebar-border: oklch(0.922 0.008 150);
  --sidebar-ring: oklch(0.453 0.113 130.93);
}

.dark {
  --background: oklch(0.16 0.008 150);
  --foreground: oklch(0.985 0.002 150);
  --card: oklch(0.205 0.008 150);
  --card-foreground: oklch(0.985 0.002 150);
  --popover: oklch(0.205 0.008 150);
  --popover-foreground: oklch(0.985 0.002 150);
  --primary: oklch(0.76 0.113 130.93);
  --primary-foreground: oklch(0.18 0.008 150);
  --secondary: oklch(0.269 0.008 150);
  --secondary-foreground: oklch(0.985 0.002 150);
  --muted: oklch(0.269 0.008 150);
  --muted-foreground: oklch(0.78 0.008 150);
  --accent: oklch(0.3 0.04 130.93);
  --accent-foreground: oklch(0.985 0.002 150);
  --destructive: oklch(0.782 0.127 22);
  --border: oklch(0.29 0.008 150);
  --input: oklch(0.34 0.008 150);
  --ring: oklch(0.76 0.113 130.93);
  --chart-1: oklch(0.82 0.113 130.93);
  --chart-2: oklch(0.7 0.104 130.93);
  --chart-3: oklch(0.6 0.095 130.93);
  --chart-4: oklch(0.5 0.086 130.93);
  --chart-5: oklch(0.42 0.077 130.93);
  --sidebar: oklch(0.205 0.008 150);
  --sidebar-foreground: oklch(0.985 0.002 150);
  --sidebar-primary: oklch(0.76 0.113 130.93);
  --sidebar-primary-foreground: oklch(0.18 0.008 150);
  --sidebar-accent: oklch(0.269 0.008 150);
  --sidebar-accent-foreground: oklch(0.985 0.002 150);
  --sidebar-border: oklch(0.29 0.008 150);
  --sidebar-ring: oklch(0.76 0.113 130.93);
}

@theme inline {
  --font-sans: "Figtree Variable", "Figtree", ui-sans-serif, system-ui, sans-serif;
  --font-heading: "Figtree Variable", "Figtree", ui-sans-serif, system-ui, sans-serif;
}

More shadcn/ui presets

All 37 presets