Install
This is the repository archive. It installs, but the folder name will carry the branch suffix and updates will not flow.
Install straight from GitHub with WP-CLI:
wp plugin install https://github.com/stijn/deluminator/archive/refs/heads/main.zipLight/dark/auto switch for aardling.com (WordPress, Twenty Nineteen). Going dark, the lit page shrinks into the switch like light into Dumbledore's Deluminator; going light, it grows back out.
The reveal follows the toggle that writewithharper.com used, which came from SveltePress: the View Transitions API takes a snapshot of the page before and after the switch and a circular clip-path grows or shrinks between them, centred on the switch. The clip is a CSS animation with fill both, so it holds from the first frame to the last and the old page never flashes back. Browsers without View Transitions, and visitors who ask for reduced motion, get an instant switch.
What it does
- Three states: Auto (follows the device, the default), Light and Dark. From Auto the first click always changes the page; the third click returns to Auto. The Auto icon matches news.eurth.org and gov.eurth.org.
- Dark palettes under Settings › Deluminator: Solarized Dark (default), WCAG Dark (AAA contrast) and Dracula. Add your own with the
deluminator_palettesfilter. - A theme with its own dark mode keeps it: Deluminator finds the theme's
prefers-color-schemestyles and makes them follow the switch instead of applying a palette. A setting can force the palette instead. - Remembers an explicit choice (
localStorage); Auto stores nothing. - Sets the mode in the
<head>before the page paints, so dark pages don't flash white on load. - Updates
color-schemeand the browser'stheme-color, keeps open tabs in step. - Real
<button>whose label says the current state and what a click does; keyboard activation starts the reveal from the switch. - Dark styles for Twenty Nineteen and the site's own extras: author box, footer, "Lees verder" pill, TL;DR boxes, Modern Footnotes, WP Mobile Bottom Menu.
- Carries over choices saved by version 0.8.
- Dutch labels (
languages/).
Release flow
- Bump the version in three places: the
Version:header andDELUMINATOR_VERSIONindeluminator.php, andStable taginreadme.txt. Add a## x.y.zsection toCHANGELOG.md. - Commit and push to
main. - GitHub Actions checks the three numbers match, lints, builds
deluminator.zipand creates releasevx.y.z. Pushes without a version bump release nothing. - aardling.com checks every 12 hours and auto-updates through WordPress's update cron (or click "Check for updates" on the Plugins screen).
One-time setup on the site
Plugins › Add New › Upload Plugin › deluminator.zip from the latest release › "Replace current with uploaded" › Activate. Updates after that arrive by themselves.
Credits
- Reveal technique: SveltePress
ToggleDark.svelte(MIT). - Sun and moon icons: line-md by Vjacheslav Trushkin (MIT).
- Vendored: plugin-update-checker 5.6 by Yahnis Elsts (MIT).