Calm motion: animations on this site only fade, with no movement
Theme maker
Pick one petal color and give the palette a name. The page makes the other accent tokens from the petal and keeps the accent contract. The preview below uses the new palette and follows the light or dark theme of this site.
The value of the data-palette attribute.
Progress64%
Contrast
- White text on accent4.52:1 ✓
- accent-text on bg and surface, light4.55:1 ✓
- accent-text on bg and surface, dark4.62:1 ✓
- chart-1 on bg and surface3.02:1 ✓
:root[data-palette="mine"] {
--bless-color-accent: #238478;
--bless-color-accent-text: #1f746a;
--bless-color-accent-soft: #8ac9c1;
--bless-color-accent-2: #4aaca0;
--bless-color-badge: #238478;
--bless-color-chart-1: #279486;
}
:root[data-palette="mine"][data-theme="dark"] {
--bless-color-accent-text: #2a9d8f;
}
@media (prefers-color-scheme: dark) {
:root[data-palette="mine"]:not([data-theme="light"]) {
--bless-color-accent-text: #2a9d8f;
}
}
Use the palette
- Copy the CSS into a stylesheet that loads after
tokens.css. - Set the attribute on
<html>, for example<html data-palette="mine">.
The page makes six tokens and one dark-mode cut, as Palettes describes:
accentis the petal, darkened until white text on it reaches 4.5:1.accent-textis the petal, darkened until it reaches 4.5:1 onbgandsurface.- The dark
accent-textis the petal, lightened until it reaches 4.5:1 on the darkbgandsurface. chart-1is the petal, darkened until it reaches 3:1 onbgandsurface.accent-softandaccent-2are lighter tints of the petal. If the petal is too pale to carry white text, it becomesaccent-softitself.badgeis the same asaccent.
The six built-in palettes come out of the same steps within one or two shades. Grays, type, and geometry do not change. To tune one value, edit it in the CSS.
setPalette() and BlessPaletteToggle know only the six built-in palettes. Set the attribute yourself for a palette of your own.