Theme appearance
Light and dark modes & theme switching
Configure initial color schemes, provide user-facing toggle switches, and hot-swap theme files without modifying page content.
1. Setting the default color scheme
Every SkinKit theme supports high-contrast light and dark palettes through native CSS custom properties. You can lock an initial palette on your root <html> element:
<!-- For an initial dark palette -->
<html lang="en" data-sk-mode="dark">
<!-- For an initial light palette -->
<html lang="en" data-sk-mode="light">
When the companion script is loaded, a saved visitor choice takes precedence over the root attribute. Without a saved choice, the script honors data-sk-mode; if neither is set, the theme uses its native default. Without the script, CSS honors the root attribute or its native default, but cannot persist visitor changes. Aura defaults to dark; Mono and Swiss Grid default to light.
2. Adding a user mode toggle button
Each theme's companion JavaScript file listens for buttons tagged with data-sk-mode-toggle. Adding this element gives visitors instant toggle capability:
<button class="btn btn-ghost btn-sm" type="button" data-sk-mode-toggle aria-pressed="false">
Toggle dark mode
</button>
The companion script handles persistence in localStorage automatically, preventing theme flash (FOIT) on page navigation.
3. Switching between themes
Because all SkinKit themes adhere to the universal component contract, switching your site from one design language to another requires only changing the stylesheet href:
<!-- Swapping from Aura to Mono -->
<!-- <link rel="stylesheet" href="/css/aura.css"> -->
<link rel="stylesheet" href="/css/mono.css">
Zero markup rework
Your headers, heroes, cards, forms, and pricing plans will instantly transform into the typography, borders, shadows, and mood of the new theme without altering semantic HTML.