| 开发者 | kimjiwoon |
|---|---|
| 更新时间 | 2026年9月6日 15:07 |
| PHP版本: | 8.1 及以上 |
| WordPress版本: | 7.1 |
| 版权: | GPL-3.0-or-later |
| 版权网址: | 版权信息 |
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.
html[data-theme]. The Axismundi theme does so natively.No. The switcher runs locally in WordPress and stores the selected mode in a
first-party cookie named 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 the data-theme attribute; the
site around it changes only if something consumes html[data-theme].