3034bf8794784d4fe520e512ca6b9ada26e64f38
TT5 Light/Dark Toggle
WordPress plugin that adds a light/dark mode toggle for the Twenty Twenty-Five theme.
Features
- Floating toggle button (bottom-right)
- Remembers choice in
localStorageand a cookie - Logged-in users: preference saved to user meta
- Respects system
prefers-color-schemeon first visit (until the user chooses) - No flash of wrong theme (inline script in
<head>) - Dark palette tuned for TT5 default color presets
Requirements
- WordPress 6.4+
- Active theme: Twenty Twenty-Five (or a child theme of it)
Installation
- Copy the
tt5-light-dark-togglefolder towp-content/plugins/. - Activate TT5 Light/Dark Toggle under Plugins.
- Visit your site — a Dark / Light button appears at the bottom-right.
How it works
Twenty Twenty-Five does not ship with a built-in light/dark switch. This plugin overrides the theme’s CSS preset variables (--wp--preset--color--*) when html has the class tt5-ldt-dark, giving a readable dark version of the default style without changing your theme files.
Notes
- Works with the default TT5 palette. If you use a style variation (Evening, Midnight, etc.), colors may look different; the toggle still swaps to a dark-friendly palette.
- Custom blocks with hard-coded hex colors in the editor are not auto-adjusted.
License
GPL-2.0-or-later
Description
Languages
PHP
52.1%
CSS
26.3%
JavaScript
21.6%