Skip to content
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.

#2a9d8f

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 ✓
palette.csscss
: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 ​

  1. Copy the CSS into a stylesheet that loads after tokens.css.
  2. Set the attribute on <html>, for example <html data-palette="mine">.

The page makes six tokens and one dark-mode cut, as Palettes describes:

  • accent is the petal, darkened until white text on it reaches 4.5:1.
  • accent-text is the petal, darkened until it reaches 4.5:1 on bg and surface.
  • The dark accent-text is the petal, lightened until it reaches 4.5:1 on the dark bg and surface.
  • chart-1 is the petal, darkened until it reaches 3:1 on bg and surface.
  • accent-soft and accent-2 are lighter tints of the petal. If the petal is too pale to carry white text, it becomes accent-soft itself.
  • badge is the same as accent.

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.

Released under the MIT License. Character names and artwork belong to their owners.