Description
The axismundi/theme-switcher block puts an Auto / Light / Dark control on the
page, as a connected button group or a single cycling button, and writes the
choice to html[data-theme]. The choice is kept in a first-party cookie and
reapplied before the next page paints, so returning to the site does not flash
the wrong scheme.
The block reads its colors, corner sizes and motion from the Material Design
system custom properties, so it looks as intended under any theme that publishes
them, and falls back to Material’s own baseline where a theme publishes none.
The Axismundi theme supports the html[data-theme] contract natively.
Blocks
This plugin provides 1 block.
- Theme Switcher Switches between Auto, Light, and Dark theme modes.
Installation
- Install and activate the plugin.
- Insert the Theme Switcher block wherever a light / dark / auto control is
needed — a header template part, a footer, or a page. - For the switch to repaint the whole site, use a theme or stylesheet that
responds tohtml[data-theme]. The Axismundi theme does so natively.
FAQ
-
Does this plugin require an external service?
-
No. The switcher runs locally in WordPress and stores the selected mode in a
first-party cookie namedaxismundi_theme. -
Can this plugin be used without the Axismundi theme?
-
Yes. The block reads its colors, corner sizes and motion from the Material
Design system custom properties —--md-sys-color-*and the shape and motion
scales beside it — so it looks as intended under any theme that publishes them.
Under a theme that publishes none it falls back to Material’s own baseline
colors, and it still renders and still toggles thedata-themeattribute; the
site around it changes only if something consumeshtml[data-theme].
Reviews
There are no reviews for this plugin.
Contributors & Developers
“Axismundi Theme Switcher” is open source software. The following people have contributed to this plugin.
ContributorsTranslate “Axismundi Theme Switcher” into your language.
Interested in development?
Browse the code, check out the SVN repository, or subscribe to the development log by RSS.
Changelog
0.1.8
- Stop inserting a switcher into the theme header automatically. The block now
goes only where it is placed, and a theme that wants one in its header can put
it in the header template. Headers that already show one are unaffected: the
Axismundi theme places it itself.
Earlier releases are listed in changelog.txt.