Skip to content

Graphite, a shadcn/ui preset

Zinc greys and Geist: the shadcn default, tightened to R49.

Fonts: Geist · radius 0.5rem · light and dark · lowest text contrast 4.77:1

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

Graphite 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#0a0a0d
  • primary#18181b
  • primary-foreground#ffffff
  • secondary#f3f4f8
  • muted-foreground#6b6b6f
  • accent#f3f4f8
  • border#e5e5e9
  • destructive#e7000a
  • ring#717175
  • chart-1#c0c0c5
  • chart-2#929296
  • chart-3#747478
  • chart-4#5a5a5e
  • chart-5#454548

Dark

  • background#0d0d10
  • foreground#fafafb
  • primary#e5e5e9
  • primary-foreground#111114
  • secondary#262629
  • muted-foreground#b8b8bd
  • accent#262629
  • border#2b2b2e
  • destructive#ff9693
  • ring#808084
  • chart-1#c3c3c8
  • chart-2#9e9ea2
  • chart-3#808084
  • chart-4#636367
  • chart-5#4d4d50

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.80:1 · Lc 10618.59:1 · Lc 104
Secondary text on the pagemuted-foreground on background5.29:1 · Lc 769.86:1 · Lc 64
Text in cardscard-foreground on card19.80:1 · Lc 10617.16:1 · Lc 104
Secondary text in cardsmuted-foreground on card5.29:1 · Lc 769.10:1 · Lc 63
Menus and popoverspopover-foreground on popover19.80:1 · Lc 10617.16:1 · Lc 104
Primary buttonsprimary-foreground on primary17.73:1 · Lc 10714.93:1 · Lc 90
Links and outline accentsprimary on background17.73:1 · Lc 10515.41:1 · Lc 91
Secondary buttonssecondary-foreground on secondary16.28:1 · Lc 9814.49:1 · Lc 101
Text on muted panelsmuted-foreground on muted4.80:1 · Lc 707.68:1 · Lc 61
Hovered menu itemsaccent-foreground on accent16.28:1 · Lc 9814.49:1 · Lc 101
Error messagesdestructive on background4.77:1 · Lc 709.27:1 · Lc 61
Sidebarsidebar-foreground on sidebar18.95:1 · Lc 10317.16:1 · Lc 104
Sidebar active itemsidebar-primary-foreground on sidebar-primary17.73:1 · Lc 10714.93:1 · Lc 90
Sidebar hoversidebar-accent-foreground on sidebar-accent16.28:1 · Lc 9814.49:1 · Lc 101
Focus ringring on background4.86:14.91: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/graphite.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/geist

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

globals.css
:root {
  --radius: 0.5rem;
  --background: oklch(1 0 0);
  --foreground: oklch(0.145 0.006 285.9);
  --card: oklch(1 0 0);
  --card-foreground: oklch(0.145 0.006 285.9);
  --popover: oklch(1 0 0);
  --popover-foreground: oklch(0.145 0.006 285.9);
  --primary: oklch(0.21 0.006 285.89);
  --primary-foreground: oklch(1 0 0);
  --secondary: oklch(0.967 0.006 285.9);
  --secondary-foreground: oklch(0.205 0.006 285.9);
  --muted: oklch(0.967 0.006 285.9);
  --muted-foreground: oklch(0.53 0.006 285.9);
  --accent: oklch(0.967 0.006 285.9);
  --accent-foreground: oklch(0.205 0.006 285.9);
  --destructive: oklch(0.583 0.239 28.5);
  --border: oklch(0.922 0.006 285.9);
  --input: oklch(0.87 0.006 285.9);
  --ring: oklch(0.55 0.006 285.9);
  --chart-1: oklch(0.81 0.006 285.9);
  --chart-2: oklch(0.66 0.006 285.9);
  --chart-3: oklch(0.56 0.006 285.9);
  --chart-4: oklch(0.47 0.006 285.9);
  --chart-5: oklch(0.39 0.006 285.9);
  --sidebar: oklch(0.985 0.006 285.9);
  --sidebar-foreground: oklch(0.145 0.006 285.9);
  --sidebar-primary: oklch(0.21 0.006 285.89);
  --sidebar-primary-foreground: oklch(1 0 0);
  --sidebar-accent: oklch(0.967 0.006 285.9);
  --sidebar-accent-foreground: oklch(0.205 0.006 285.9);
  --sidebar-border: oklch(0.922 0.006 285.9);
  --sidebar-ring: oklch(0.55 0.006 285.9);
}

.dark {
  --background: oklch(0.16 0.006 285.9);
  --foreground: oklch(0.985 0.002 285.9);
  --card: oklch(0.205 0.006 285.9);
  --card-foreground: oklch(0.985 0.002 285.9);
  --popover: oklch(0.205 0.006 285.9);
  --popover-foreground: oklch(0.985 0.002 285.9);
  --primary: oklch(0.922 0.006 285.9);
  --primary-foreground: oklch(0.18 0.006 285.9);
  --secondary: oklch(0.269 0.006 285.9);
  --secondary-foreground: oklch(0.985 0.002 285.9);
  --muted: oklch(0.269 0.006 285.9);
  --muted-foreground: oklch(0.785 0.006 285.9);
  --accent: oklch(0.269 0.006 285.9);
  --accent-foreground: oklch(0.985 0.002 285.9);
  --destructive: oklch(0.782 0.127 22);
  --border: oklch(0.29 0.006 285.9);
  --input: oklch(0.34 0.006 285.9);
  --ring: oklch(0.6 0.006 285.9);
  --chart-1: oklch(0.82 0.006 285.9);
  --chart-2: oklch(0.7 0.006 285.9);
  --chart-3: oklch(0.6 0.006 285.9);
  --chart-4: oklch(0.5 0.006 285.9);
  --chart-5: oklch(0.42 0.006 285.9);
  --sidebar: oklch(0.205 0.006 285.9);
  --sidebar-foreground: oklch(0.985 0.002 285.9);
  --sidebar-primary: oklch(0.922 0.006 285.9);
  --sidebar-primary-foreground: oklch(0.18 0.006 285.9);
  --sidebar-accent: oklch(0.269 0.006 285.9);
  --sidebar-accent-foreground: oklch(0.985 0.002 285.9);
  --sidebar-border: oklch(0.29 0.006 285.9);
  --sidebar-ring: oklch(0.6 0.006 285.9);
}

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

More shadcn/ui presets

All 37 presets