Skip to main content
Aikeedo lets administrators decide which color modes a site offers and which one is the default. A theme reads that setting, applies the right mode before the page paints, and styles both.

The setting

option.color_scheme holds:

Apply the mode before paint

Resolve the mode in the document head, so there’s no flash of the wrong theme:
snippets/js.twig
The result is <html data-mode="dark">, which is what your CSS keys off.

Define the palette

Declare colors as space-separated RGB channels, so Tailwind can apply opacity to them:
snippets/css.twig
tailwind.config.js
With darkMode bound to the attribute, dark: variants work as usual:
Because every color is a variable, one block of overrides under [data-mode="dark"] themes the whole site. Avoid hardcoding hex values in templates.

The switcher

Show a toggle only when more than one mode is available:
The starter’s mode-switcher element flips localStorage.mode and updates document.documentElement.dataset.mode, so the choice survives navigation.

Using the configured accent

The accent color is exposed ready to drop into a variable:
The bundled themes ship fixed palettes and ignore the accent setting. Reading it makes your theme adjustable from the admin panel without a rebuild, which is usually what customers expect.

Checklist

The mode is applied in the head, before the body renders.
Only the configured modes are reachable, and the switcher hides when there’s one.
Both modes are checked for contrast, including borders and dimmed text.
Images and logos have dark variants where they need them, for example option.brand.logo_dark.
The choice persists across page loads.