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.jsonGraphite 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.
| Where | Pair | Light | Dark |
|---|---|---|---|
| Body text | foreground on background | 19.80:1 · Lc 106 | 18.59:1 · Lc 104 |
| Secondary text on the page | muted-foreground on background | 5.29:1 · Lc 76 | 9.86:1 · Lc 64 |
| Text in cards | card-foreground on card | 19.80:1 · Lc 106 | 17.16:1 · Lc 104 |
| Secondary text in cards | muted-foreground on card | 5.29:1 · Lc 76 | 9.10:1 · Lc 63 |
| Menus and popovers | popover-foreground on popover | 19.80:1 · Lc 106 | 17.16:1 · Lc 104 |
| Primary buttons | primary-foreground on primary | 17.73:1 · Lc 107 | 14.93:1 · Lc 90 |
| Links and outline accents | primary on background | 17.73:1 · Lc 105 | 15.41:1 · Lc 91 |
| Secondary buttons | secondary-foreground on secondary | 16.28:1 · Lc 98 | 14.49:1 · Lc 101 |
| Text on muted panels | muted-foreground on muted | 4.80:1 · Lc 70 | 7.68:1 · Lc 61 |
| Hovered menu items | accent-foreground on accent | 16.28:1 · Lc 98 | 14.49:1 · Lc 101 |
| Error messages | destructive on background | 4.77:1 · Lc 70 | 9.27:1 · Lc 61 |
| Sidebar | sidebar-foreground on sidebar | 18.95:1 · Lc 103 | 17.16:1 · Lc 104 |
| Sidebar active item | sidebar-primary-foreground on sidebar-primary | 17.73:1 · Lc 107 | 14.93:1 · Lc 90 |
| Sidebar hover | sidebar-accent-foreground on sidebar-accent | 16.28:1 · Lc 98 | 14.49:1 · Lc 101 |
| Focus ring | ring on background | 4.86:1 | 4.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.jsonOr 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/geistThe registry item: themes.dev/r/presets/graphite.json. Free to use in any project.
: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;
}