Customization
husk uses CSS custom properties for all design decisions. Override them on :root to
theme
everything at once.
Quick theming
Add a <style> block after the husk CSS import to override tokens:
<link rel="stylesheet" href="husk.css">
<style>
:root {
--husk-accent: #e11d48;
--husk-radius: 8px;
--husk-font: "Inter", sans-serif;
}
</style>
That's it. Every component that uses these tokens will update automatically — buttons, links, focus rings, progress bars, switches, and more.
Colors
The color system uses a small set of semantic tokens. Each semantic color has three variants: the
base, a
light background (-bg), and a dark foreground (-fg).
Core
| Token | Default | Usage |
|---|---|---|
| --husk-bg | #ffffff | Page background |
| --husk-fg | #37352f | Text color |
| --husk-muted | #787774 | Secondary text, labels |
| --husk-surface | #f7f6f3 | Card backgrounds, code blocks |
| --husk-surface-hover | rgba(55,53,47, 0.04) | Hover state backgrounds |
| --husk-accent | #2eaadc | Primary action color |
| --husk-accent-hover | #2496c4 | Primary hover |
Borders
| Token | Default | Usage |
|---|---|---|
| --husk-border | rgba(55,53,47, 0.09) | Subtle dividers (transparent) |
| --husk-border-solid | #e9e9e7 | Input borders, solid lines |
Semantic colors
| Token | Default | Usage |
|---|---|---|
| --husk-success | #4dab9a | Success base |
| --husk-success-bg | rgba(77,171,154, 0.08) | Success background (badges, alerts) |
| --husk-success-fg | #2b7a6b | Success text / toast |
| --husk-warning | #cb912f | Warning base |
| --husk-warning-bg | rgba(203,145,47, 0.08) | Warning background |
| --husk-warning-fg | #9a6c1e | Warning text / toast |
| --husk-danger | #e16259 | Danger base |
| --husk-danger-bg | rgba(225,98,89, 0.08) | Danger background |
| --husk-danger-fg | #c4443c | Danger text / toast |
| --husk-info | #529cca | Info base |
| --husk-info-bg | rgba(82,156,202, 0.08) | Info background |
| --husk-info-fg | #3a7ba8 | Info text / toast |
Typography
| Token | Default |
|---|---|
| --husk-font | -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif |
| --husk-font-mono | "SFMono-Regular", Menlo, Consolas, "PT Mono", monospace |
| --husk-font-size | 16px |
| --husk-leading | 1.5 |
Override the font to use a custom typeface:
:root {
--husk-font: "Inter", -apple-system, sans-serif;
--husk-font-mono: "JetBrains Mono", monospace;
}
Shape & Radius
| Token | Default | Usage |
|---|---|---|
| --husk-radius-sm | 3px | Small elements (badges, code) |
| --husk-radius | 4px | Default (buttons, inputs, cards) |
| --husk-radius-lg | 6px | Larger elements (toasts, dialogs) |
| --husk-radius-full | 9999px | Pills and circles |
Want fully rounded? Set all to the same value:
:root {
--husk-radius: 9999px;
--husk-radius-sm: 9999px;
--husk-radius-lg: 9999px;
}
Want sharp corners?
:root {
--husk-radius: 0;
--husk-radius-sm: 0;
--husk-radius-lg: 0;
}
Shadows
| Token | Usage |
|---|---|
| --husk-shadow-sm | Switch knobs, subtle elevation |
| --husk-shadow | Default card shadow |
| --husk-shadow-md | Toasts, dropdowns |
| --husk-shadow-lg | Modals, dialogs |
Disable all shadows:
:root {
--husk-shadow-sm: none;
--husk-shadow: none;
--husk-shadow-md: none;
--husk-shadow-lg: none;
}
Motion
| Token | Default |
|---|---|
| --husk-ease | 120ms ease-out |
For reduced motion or no transitions:
:root {
--husk-ease: 0ms;
}
Dark mode
husk respects prefers-color-scheme: dark automatically. All tokens are redefined in the
dark
media query — you don't need to do anything.
To override dark mode colors specifically:
@media (prefers-color-scheme: dark) {
:root {
--husk-accent: #f472b6;
--husk-bg: #0f0f0f;
}
}
To force a specific mode regardless of system preference, set the tokens explicitly on your page and
disable the automatic detection with color-scheme:
/* Force light mode */
:root {
color-scheme: light;
}
/* Force dark mode */
:root {
color-scheme: dark;
--husk-bg: #191919;
--husk-fg: #ffffffcf;
/* ... override all dark tokens ... */
}
All tokens
Complete list of every --husk-* custom property.
| Token | Light | Dark |
|---|---|---|
| --husk-bg | #ffffff | #191919 |
| --husk-fg | #37352f | #ffffffcf |
| --husk-muted | #787774 | #ffffff5e |
| --husk-border | rgba(55,53,47, .09) | rgba(255,255,255, .07) |
| --husk-border-solid | #e9e9e7 | #2f2f2f |
| --husk-accent | #2eaadc | #529cca |
| --husk-accent-hover | #2496c4 | #68aed4 |
| --husk-accent-text | #ffffff | #191919 |
| --husk-success | #4dab9a | (same) |
| --husk-success-bg | rgba(77,171,154, .08) | rgba(77,171,154, .12) |
| --husk-success-fg | #2b7a6b | #6bc5b5 |
| --husk-warning | #cb912f | (same) |
| --husk-warning-bg | rgba(203,145,47, .08) | rgba(203,145,47, .12) |
| --husk-warning-fg | #9a6c1e | #dfb564 |
| --husk-danger | #e16259 | (same) |
| --husk-danger-bg | rgba(225,98,89, .08) | rgba(225,98,89, .12) |
| --husk-danger-fg | #c4443c | #e98a84 |
| --husk-info | #529cca | (same) |
| --husk-info-bg | rgba(82,156,202, .08) | rgba(82,156,202, .12) |
| --husk-info-fg | #3a7ba8 | #7db8da |
| --husk-surface | #f7f6f3 | #ffffff08 |
| --husk-surface-hover | rgba(55,53,47, .04) | rgba(255,255,255, .04) |
| --husk-font | System font stack | |
| --husk-font-mono | Monospace font stack | |
| --husk-font-size | 16px | |
| --husk-leading | 1.5 | |
| --husk-radius-sm | 3px | |
| --husk-radius | 4px | |
| --husk-radius-lg | 6px | |
| --husk-radius-full | 9999px | |
| --husk-ease | 120ms ease-out | |