Customization
Theming
CSS variables for color, shape and animation.
Color
Density
Radius
:root {
--skeleton-color: color-mix(in srgb, #00c16a 20%, transparent);
--skeleton-radius: 6px;
}Variables
| Variable | Purpose |
|---|---|
--skeleton-color | bone color |
--skeleton-line-color | color of remembered borders and dividers; by default each keeps its own border color |
--skeleton-radius | bar corner radius |
--skeleton-highlight | shimmer color |
--skeleton-shimmer | none turns the shimmer off |
--skeleton-pulse | skeleton-pulse turns pulsing on |
--skeleton-hold | how long to wait before showing a skeleton, 150ms by default |
--skeleton-text-top | where a text bar starts: cap-height by default, ascender or x-height |
--skeleton-text-bottom | where a text bar ends: descender by default, or baseline |
Dark mode
Variables are plain CSS, so dark mode works like everything else:
:root { --skeleton-color: rgb(0 0 0 / 0.08); }
.dark { --skeleton-color: rgb(255 255 255 / 0.09); }
With prefers-reduced-motion, animation turns itself off.