Serval is a shadcn/ui theme built around a deep green primary color (#465f11) with deep purple accents (#5f1146). The light mode uses a neutral background (#fafcf8). Dark mode keeps the deep green primary (#465f11) on a green-tinted background (#0c1005).
| Token | Light | Dark |
|---|---|---|
| Background | #fafcf8snow | #0c1005black |
| Foreground | #0c1004black | #f8f9f6whitesmoke |
| Card | #fafcf8snow | #0c1005black |
| Card foreground | #0c1004black | #f8f9f6whitesmoke |
| Popover | #fafcf8snow | #0c1005black |
| Popover foreground | #0c1004black | #f8f9f6whitesmoke |
| Primary | #465f11darkolivegreen | #465f11darkolivegreen |
| Primary foreground | #ffffffwhite | #ffffffwhite |
| Secondary | #11465fdarkslategray | #11465fdarkslategray |
| Secondary foreground | #b1ddf1powderblue | #b1ddf1powderblue |
| Muted | #e4e6e7gainsboro | #181a1bblack |
| Muted foreground | #4a5154darkslategray | #abb2b5darkgray |
| Accent | #5f1146indigo | #5f1146indigo |
| Accent foreground | #f1b1ddplum | #f1b1ddplum |
| Destructive | #c64715chocolate | #ea6b39tomato |
| Destructive foreground | #ffffffwhite | #000000black |
| Border | #e5e7eblavender | #1f2937darkslategray |
| Input | #e5e7eblavender | #1f2937darkslategray |
| Ring | #465f11darkolivegreen | #465f11darkolivegreen |
WCAG 2 contrast ratios between each background and its foreground color.
| Text on background | 18.60:1 | AAA |
| Text on card | 18.60:1 | AAA |
| Primary button | 7.23:1 | AAA |
| Secondary button | 6.98:1 | AA |
| Muted text | 6.46:1 | AA |
| Accent | 7.28:1 | AAA |
| Destructive | 4.84:1 | AA |
| Text on background | 18.22:1 | AAA |
| Text on card | 18.22:1 | AAA |
| Primary button | 7.23:1 | AAA |
| Secondary button | 6.98:1 | AA |
| Muted text | 8.11:1 | AAA |
| Accent | 7.28:1 | AAA |
| Destructive | 6.65:1 | AA |
Paste this into your globals.css to use Serval in your shadcn/ui project.
:root {
--radius: 0.5rem;
--background: oklch(0.988 0.004 120.842);
--foreground: oklch(0.166 0.027 122.28);
--muted: oklch(0.924 0.003 226.891);
--muted-foreground: oklch(0.429 0.01 227.152);
--popover: oklch(0.988 0.004 120.842);
--popover-foreground: oklch(0.166 0.027 122.28);
--card: oklch(0.988 0.004 120.842);
--card-foreground: oklch(0.166 0.027 122.28);
--border: oklch(0.928 0.006 264.531);
--input: oklch(0.928 0.006 264.531);
--primary: oklch(0.449 0.105 126.147);
--primary-foreground: oklch(1 0 180);
--secondary: oklch(0.374 0.068 233.293);
--secondary-foreground: oklch(0.873 0.053 227.809);
--accent: oklch(0.337 0.123 343.999);
--accent-foreground: oklch(0.833 0.092 338.586);
--destructive: oklch(0.569 0.172 38.849);
--destructive-foreground: oklch(1 0 180);
--ring: oklch(0.449 0.105 126.147);
--chart-1: oklch(0.449 0.105 126.147);
--chart-2: oklch(0.374 0.068 233.293);
--chart-3: oklch(0.337 0.123 343.999);
--chart-4: oklch(0.407 0.075 233.539);
--chart-5: oklch(0.454 0.108 126.36);
}
.dark {
--radius: 0.5rem;
--background: oklch(0.164 0.024 122.162);
--foreground: oklch(0.98 0.003 120.824);
--muted: oklch(0.216 0.004 227.077);
--muted-foreground: oklch(0.758 0.008 226.996);
--popover: oklch(0.164 0.024 122.162);
--popover-foreground: oklch(0.98 0.003 120.824);
--card: oklch(0.164 0.024 122.162);
--card-foreground: oklch(0.98 0.003 120.824);
--border: oklch(0.278 0.03 256.848);
--input: oklch(0.278 0.03 256.848);
--primary: oklch(0.449 0.105 126.147);
--primary-foreground: oklch(1 0 180);
--secondary: oklch(0.374 0.068 233.293);
--secondary-foreground: oklch(0.873 0.053 227.809);
--accent: oklch(0.337 0.123 343.999);
--accent-foreground: oklch(0.833 0.092 338.586);
--destructive: oklch(0.674 0.17 40.816);
--destructive-foreground: oklch(0 0 0);
--ring: oklch(0.449 0.105 126.147);
--chart-1: oklch(0.449 0.105 126.147);
--chart-2: oklch(0.374 0.068 233.293);
--chart-3: oklch(0.337 0.123 343.999);
--chart-4: oklch(0.407 0.075 233.539);
--chart-5: oklch(0.454 0.108 126.36);
}