OKLCH Studio · shadcn/ui base colour
shadcn/ui Mist theme: OKLCH CSS variables, hex & contrast
shadcn/ui Mist: primary #161b1d light / #e3e7e8 dark (oklch(0.218 0.008 223.9)). 21 of 22 checked pairs meet WCAG AA 4.5:1 (light 10/11, dark 11/11). Copy the full light and dark token set as OKLCH, @theme mapping or hex.
Mist is a base colour: it defines the complete token set for light and dark mode. Source: shadcn/ui (MIT, © 2023 shadcn); all themes.
Preview
Card title
Muted description text on the card.
Muted block with input border
Card title
Muted description text on the card.
Muted block with input border
light mode tokens
| Token | Swatch | oklch() | Hex | In sRGB |
|---|---|---|---|---|
| --background | oklch(1 0 0) | #ffffff | Yes | |
| --foreground | oklch(0.148 0.004 228.8) | #090b0c | Yes | |
| --card | oklch(1 0 0) | #ffffff | Yes | |
| --card-foreground | oklch(0.148 0.004 228.8) | #090b0c | Yes | |
| --popover | oklch(1 0 0) | #ffffff | Yes | |
| --popover-foreground | oklch(0.148 0.004 228.8) | #090b0c | Yes | |
| --primary | oklch(0.218 0.008 223.9) | #161b1d | Yes | |
| --primary-foreground | oklch(0.987 0.002 197.1) | #f9fbfb | Yes | |
| --secondary | oklch(0.963 0.002 197.1) | #f1f3f3 | Yes | |
| --secondary-foreground | oklch(0.218 0.008 223.9) | #161b1d | Yes | |
| --muted | oklch(0.963 0.002 197.1) | #f1f3f3 | Yes | |
| --muted-foreground | oklch(0.56 0.021 213.5) | #67787c | Yes | |
| --accent | oklch(0.963 0.002 197.1) | #f1f3f3 | Yes | |
| --accent-foreground | oklch(0.218 0.008 223.9) | #161b1d | Yes | |
| --destructive | oklch(0.577 0.245 27.325) | #e7000b | No — hex is clipped | |
| --border | oklch(0.925 0.005 214.3) | #e3e7e8 | Yes | |
| --input | oklch(0.925 0.005 214.3) | #e3e7e8 | Yes | |
| --ring | oklch(0.723 0.014 214.4) | #9ca8ab | Yes | |
| --chart-1 | oklch(0.872 0.007 219.6) | #d0d6d8 | Yes | |
| --chart-2 | oklch(0.56 0.021 213.5) | #67787c | Yes | |
| --chart-3 | oklch(0.45 0.017 213.2) | #4b585b | Yes | |
| --chart-4 | oklch(0.378 0.015 216) | #394447 | Yes | |
| --chart-5 | oklch(0.275 0.011 216.9) | #22292b | Yes | |
| --sidebar | oklch(0.987 0.002 197.1) | #f9fbfb | Yes | |
| --sidebar-foreground | oklch(0.148 0.004 228.8) | #090b0c | Yes | |
| --sidebar-primary | oklch(0.218 0.008 223.9) | #161b1d | Yes | |
| --sidebar-primary-foreground | oklch(0.987 0.002 197.1) | #f9fbfb | Yes | |
| --sidebar-accent | oklch(0.963 0.002 197.1) | #f1f3f3 | Yes | |
| --sidebar-accent-foreground | oklch(0.218 0.008 223.9) | #161b1d | Yes | |
| --sidebar-border | oklch(0.925 0.005 214.3) | #e3e7e8 | Yes | |
| --sidebar-ring | oklch(0.723 0.014 214.4) | #9ca8ab | Yes |
dark mode tokens
| Token | Swatch | oklch() | Hex | In sRGB |
|---|---|---|---|---|
| --background | oklch(0.148 0.004 228.8) | #090b0c | Yes | |
| --foreground | oklch(0.987 0.002 197.1) | #f9fbfb | Yes | |
| --card | oklch(0.218 0.008 223.9) | #161b1d | Yes | |
| --card-foreground | oklch(0.987 0.002 197.1) | #f9fbfb | Yes | |
| --popover | oklch(0.218 0.008 223.9) | #161b1d | Yes | |
| --popover-foreground | oklch(0.987 0.002 197.1) | #f9fbfb | Yes | |
| --primary | oklch(0.925 0.005 214.3) | #e3e7e8 | Yes | |
| --primary-foreground | oklch(0.218 0.008 223.9) | #161b1d | Yes | |
| --secondary | oklch(0.275 0.011 216.9) | #22292b | Yes | |
| --secondary-foreground | oklch(0.987 0.002 197.1) | #f9fbfb | Yes | |
| --muted | oklch(0.275 0.011 216.9) | #22292b | Yes | |
| --muted-foreground | oklch(0.723 0.014 214.4) | #9ca8ab | Yes | |
| --accent | oklch(0.275 0.011 216.9) | #22292b | Yes | |
| --accent-foreground | oklch(0.987 0.002 197.1) | #f9fbfb | Yes | |
| --destructive | oklch(0.704 0.191 22.216) | #ff6467 | No — hex is clipped | |
| --border | oklch(1 0 0 / 10%) | #ffffff (10% alpha) | Yes | |
| --input | oklch(1 0 0 / 15%) | #ffffff (15% alpha) | Yes | |
| --ring | oklch(0.56 0.021 213.5) | #67787c | Yes | |
| --chart-1 | oklch(0.872 0.007 219.6) | #d0d6d8 | Yes | |
| --chart-2 | oklch(0.56 0.021 213.5) | #67787c | Yes | |
| --chart-3 | oklch(0.45 0.017 213.2) | #4b585b | Yes | |
| --chart-4 | oklch(0.378 0.015 216) | #394447 | Yes | |
| --chart-5 | oklch(0.275 0.011 216.9) | #22292b | Yes | |
| --sidebar | oklch(0.218 0.008 223.9) | #161b1d | Yes | |
| --sidebar-foreground | oklch(0.987 0.002 197.1) | #f9fbfb | Yes | |
| --sidebar-primary | oklch(0.488 0.243 264.376) | #1447e6 | Yes | |
| --sidebar-primary-foreground | oklch(0.987 0.002 197.1) | #f9fbfb | Yes | |
| --sidebar-accent | oklch(0.275 0.011 216.9) | #22292b | Yes | |
| --sidebar-accent-foreground | oklch(0.987 0.002 197.1) | #f9fbfb | Yes | |
| --sidebar-border | oklch(1 0 0 / 10%) | #ffffff (10% alpha) | Yes | |
| --sidebar-ring | oklch(0.56 0.021 213.5) | #67787c | Yes |
Contrast audit (WCAG 2)
21 of 22 checked pairs meet AA 4.5:1. Pairs with a translucent side are skipped. A suggested fix keeps hue and chroma and moves the foreground's lightness to the nearest AA value, using the same logic as the contrast checker.
| Pair | Ratio | APCA Lc | AA 4.5 | AA large 3 | Fix / details |
|---|---|---|---|---|---|
| foreground on background#090b0c on #ffffff | 19.72:1 | 106 | Pass | Pass | Pair page → |
| card-foreground on card#090b0c on #ffffff | 19.72:1 | 106 | Pass | Pass | Pair page → |
| popover-foreground on popover#090b0c on #ffffff | 19.72:1 | 106 | Pass | Pass | Pair page → |
| primary-foreground on primary#f9fbfb on #161b1d | 16.72:1 | -104 | Pass | Pass | |
| secondary-foreground on secondary#161b1d on #f1f3f3 | 15.60:1 | 97 | Pass | Pass | |
| muted-foreground on muted#67787c on #f1f3f3 | 4.13:1 | 65 | Fail | Pass | Set muted-foreground to oklch(0.520 0.021 213.5) (#5c6c70, 4.91:1). |
| muted-foreground on background#67787c on #ffffff | 4.61:1 | 72 | Pass | Pass | Pair page → |
| accent-foreground on accent#161b1d on #f1f3f3 | 15.60:1 | 97 | Pass | Pass | |
| destructive on background#e7000b on #ffffff | 4.76:1 | 70 | Pass | Pass | Pair page → |
| sidebar-foreground on sidebar#090b0c on #f9fbfb | 18.98:1 | 103 | Pass | Pass | |
| sidebar-primary-foreground on sidebar-primary#f9fbfb on #161b1d | 16.72:1 | -104 | Pass | Pass |
| Pair | Ratio | APCA Lc | AA 4.5 | AA large 3 | Fix / details |
|---|---|---|---|---|---|
| foreground on background#f9fbfb on #090b0c | 18.98:1 | -105 | Pass | Pass | |
| card-foreground on card#f9fbfb on #161b1d | 16.72:1 | -104 | Pass | Pass | |
| popover-foreground on popover#f9fbfb on #161b1d | 16.72:1 | -104 | Pass | Pass | |
| primary-foreground on primary#161b1d on #e3e7e8 | 13.95:1 | 90 | Pass | Pass | |
| secondary-foreground on secondary#f9fbfb on #22292b | 14.23:1 | -102 | Pass | Pass | |
| muted-foreground on muted#9ca8ab on #22292b | 6.05:1 | -51 | Pass | Pass | |
| muted-foreground on background#9ca8ab on #090b0c | 8.07:1 | -54 | Pass | Pass | |
| accent-foreground on accent#f9fbfb on #22292b | 14.23:1 | -102 | Pass | Pass | |
| destructive on background#ff6467 on #090b0c | 6.82:1 | -47 | Pass | Pass | |
| sidebar-foreground on sidebar#f9fbfb on #161b1d | 16.72:1 | -104 | Pass | Pass | |
| sidebar-primary-foreground on sidebar-primary#f9fbfb on #1447e6 | 6.57:1 | -85 | Pass | Pass |
Copy code
shadcn/ui v4 globals.css (OKLCH)
:root {
--background: oklch(1 0 0);
--foreground: oklch(0.148 0.004 228.8);
--card: oklch(1 0 0);
--card-foreground: oklch(0.148 0.004 228.8);
--popover: oklch(1 0 0);
--popover-foreground: oklch(0.148 0.004 228.8);
--primary: oklch(0.218 0.008 223.9);
--primary-foreground: oklch(0.987 0.002 197.1);
--secondary: oklch(0.963 0.002 197.1);
--secondary-foreground: oklch(0.218 0.008 223.9);
--muted: oklch(0.963 0.002 197.1);
--muted-foreground: oklch(0.56 0.021 213.5);
--accent: oklch(0.963 0.002 197.1);
--accent-foreground: oklch(0.218 0.008 223.9);
--destructive: oklch(0.577 0.245 27.325);
--border: oklch(0.925 0.005 214.3);
--input: oklch(0.925 0.005 214.3);
--ring: oklch(0.723 0.014 214.4);
--chart-1: oklch(0.872 0.007 219.6);
--chart-2: oklch(0.56 0.021 213.5);
--chart-3: oklch(0.45 0.017 213.2);
--chart-4: oklch(0.378 0.015 216);
--chart-5: oklch(0.275 0.011 216.9);
--radius: 0.625rem;
--sidebar: oklch(0.987 0.002 197.1);
--sidebar-foreground: oklch(0.148 0.004 228.8);
--sidebar-primary: oklch(0.218 0.008 223.9);
--sidebar-primary-foreground: oklch(0.987 0.002 197.1);
--sidebar-accent: oklch(0.963 0.002 197.1);
--sidebar-accent-foreground: oklch(0.218 0.008 223.9);
--sidebar-border: oklch(0.925 0.005 214.3);
--sidebar-ring: oklch(0.723 0.014 214.4);
}
.dark {
--background: oklch(0.148 0.004 228.8);
--foreground: oklch(0.987 0.002 197.1);
--card: oklch(0.218 0.008 223.9);
--card-foreground: oklch(0.987 0.002 197.1);
--popover: oklch(0.218 0.008 223.9);
--popover-foreground: oklch(0.987 0.002 197.1);
--primary: oklch(0.925 0.005 214.3);
--primary-foreground: oklch(0.218 0.008 223.9);
--secondary: oklch(0.275 0.011 216.9);
--secondary-foreground: oklch(0.987 0.002 197.1);
--muted: oklch(0.275 0.011 216.9);
--muted-foreground: oklch(0.723 0.014 214.4);
--accent: oklch(0.275 0.011 216.9);
--accent-foreground: oklch(0.987 0.002 197.1);
--destructive: oklch(0.704 0.191 22.216);
--border: oklch(1 0 0 / 10%);
--input: oklch(1 0 0 / 15%);
--ring: oklch(0.56 0.021 213.5);
--chart-1: oklch(0.872 0.007 219.6);
--chart-2: oklch(0.56 0.021 213.5);
--chart-3: oklch(0.45 0.017 213.2);
--chart-4: oklch(0.378 0.015 216);
--chart-5: oklch(0.275 0.011 216.9);
--sidebar: oklch(0.218 0.008 223.9);
--sidebar-foreground: oklch(0.987 0.002 197.1);
--sidebar-primary: oklch(0.488 0.243 264.376);
--sidebar-primary-foreground: oklch(0.987 0.002 197.1);
--sidebar-accent: oklch(0.275 0.011 216.9);
--sidebar-accent-foreground: oklch(0.987 0.002 197.1);
--sidebar-border: oklch(1 0 0 / 10%);
--sidebar-ring: oklch(0.56 0.021 213.5);
}Tailwind v4 @theme inline mapping
@theme inline {
--color-background: var(--background);
--color-foreground: var(--foreground);
--color-card: var(--card);
--color-card-foreground: var(--card-foreground);
--color-popover: var(--popover);
--color-popover-foreground: var(--popover-foreground);
--color-primary: var(--primary);
--color-primary-foreground: var(--primary-foreground);
--color-secondary: var(--secondary);
--color-secondary-foreground: var(--secondary-foreground);
--color-muted: var(--muted);
--color-muted-foreground: var(--muted-foreground);
--color-accent: var(--accent);
--color-accent-foreground: var(--accent-foreground);
--color-destructive: var(--destructive);
--color-border: var(--border);
--color-input: var(--input);
--color-ring: var(--ring);
--color-chart-1: var(--chart-1);
--color-chart-2: var(--chart-2);
--color-chart-3: var(--chart-3);
--color-chart-4: var(--chart-4);
--color-chart-5: var(--chart-5);
--color-sidebar: var(--sidebar);
--color-sidebar-foreground: var(--sidebar-foreground);
--color-sidebar-primary: var(--sidebar-primary);
--color-sidebar-primary-foreground: var(--sidebar-primary-foreground);
--color-sidebar-accent: var(--sidebar-accent);
--color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
--color-sidebar-border: var(--sidebar-border);
--color-sidebar-ring: var(--sidebar-ring);
}Hex fallback (for tools without OKLCH support)
:root {
--background: #ffffff;
--foreground: #090b0c;
--card: #ffffff;
--card-foreground: #090b0c;
--popover: #ffffff;
--popover-foreground: #090b0c;
--primary: #161b1d;
--primary-foreground: #f9fbfb;
--secondary: #f1f3f3;
--secondary-foreground: #161b1d;
--muted: #f1f3f3;
--muted-foreground: #67787c;
--accent: #f1f3f3;
--accent-foreground: #161b1d;
--destructive: #e7000b;
--border: #e3e7e8;
--input: #e3e7e8;
--ring: #9ca8ab;
--chart-1: #d0d6d8;
--chart-2: #67787c;
--chart-3: #4b585b;
--chart-4: #394447;
--chart-5: #22292b;
--radius: 0.625rem;
--sidebar: #f9fbfb;
--sidebar-foreground: #090b0c;
--sidebar-primary: #161b1d;
--sidebar-primary-foreground: #f9fbfb;
--sidebar-accent: #f1f3f3;
--sidebar-accent-foreground: #161b1d;
--sidebar-border: #e3e7e8;
--sidebar-ring: #9ca8ab;
}
.dark {
--background: #090b0c;
--foreground: #f9fbfb;
--card: #161b1d;
--card-foreground: #f9fbfb;
--popover: #161b1d;
--popover-foreground: #f9fbfb;
--primary: #e3e7e8;
--primary-foreground: #161b1d;
--secondary: #22292b;
--secondary-foreground: #f9fbfb;
--muted: #22292b;
--muted-foreground: #9ca8ab;
--accent: #22292b;
--accent-foreground: #f9fbfb;
--destructive: #ff6467;
--border: #ffffff1a;
--input: #ffffff26;
--ring: #67787c;
--chart-1: #d0d6d8;
--chart-2: #67787c;
--chart-3: #4b585b;
--chart-4: #394447;
--chart-5: #22292b;
--sidebar: #161b1d;
--sidebar-foreground: #f9fbfb;
--sidebar-primary: #1447e6;
--sidebar-primary-foreground: #f9fbfb;
--sidebar-accent: #22292b;
--sidebar-accent-foreground: #f9fbfb;
--sidebar-border: #ffffff1a;
--sidebar-ring: #67787c;
}Related colours
Light primary: oklch(0.218 0.008 223.9) · #161b1d