___ ___ _____ _ ( _`\ ( _`\ ( _ ) _ ( ) | (_(_)| |_) )| (_) |(_) ___ | |__ `\__ \ | ,__/'| _ || |/',__)| _ `\ ( )_) || | | | | || |\__, \| | | | `\____)(_) (_) (_)(_)(____/(_) (_) A PicoSSG tool

spaish.colorScheme

API for managing light/dark color scheme toggling and persistence.

toggle()

Toggles the current color scheme between light and dark mode.

Parameters

None

Description

DOM Requirements

Example

spaish.colorScheme.toggle();
// If current theme was 'light', switches to 'dark'
// If current theme was 'dark', switches to 'light'
// If no theme was set, defaults to 'dark'

restoreLast()

Restores the previously saved color scheme or falls back to system preference.

Parameters

None

Description

DOM Requirements

Example

spaish.colorScheme.restoreLast();
// Restores 'dark' if previously saved
// Otherwise uses system preference
// Falls back to 'light' if system preference unavailable

Browser Support