2026-06-05 11:16:42 +00:00
2026-06-05 11:16:42 +00:00

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 localStorage and a cookie
  • Logged-in users: preference saved to user meta
  • Respects system prefers-color-scheme on 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

  1. Copy the tt5-light-dark-toggle folder to wp-content/plugins/.
  2. Activate TT5 Light/Dark Toggle under Plugins.
  3. 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 themes 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

S
Description
No description provided
Readme 30 KiB
Languages
PHP 52.1%
CSS 26.3%
JavaScript 21.6%