Skip to content

Theming and color

Loaders use currentColor by default, so they match the text around them. Pass color to choose another: any CSS color works, including var(--brand), oklch() and color-mix().

mount(el, { color: 'var(--brand)' });
<mulling-status color="oklch(62% 0.19 264)"></mulling-status>

Theme changes are picked up automatically when they come from:

  • a class or data-theme, data-mode or data-color-scheme attribute on <html> or <body>, including a <body> replaced by a page-swap tool such as Turbo;
  • the system light or dark setting;
  • forced-colors mode, such as Windows High Contrast, where system colors are used instead;
  • the end of a color transition on <html> or <body>, so a theme that fades doesn’t leave canvas loaders in the old color.

If your theme changes some other way, call refresh() on the loader (or on the <mulling-status> element).

  • done and error draw in --mulling-done and --mulling-error, defaulting to the loader color.
  • The blink loader picks white or near-black eyes, whichever contrasts more with its body. To choose yourself, set --mulling-eye, for example --mulling-eye: var(--surface).