Linux 软件免费装
Banner图

Mini Dark Mode

开发者 plugnest
更新时间 2026年10月12日 21:09
PHP版本: 7.2 及以上
WordPress版本: 7.1
版权: GPLv2 or later
版权网址: 版权信息

标签

accessibility dark mode darkmode night mode dark theme

下载

1.0

详情介绍:

Mini Dark Mode adds a dark mode switch to your site. Instead of running filters over every image or inverting your whole page (approaches that can break galleries, maps and photos), it toggles one class on the html element and lets a small set of CSS variables recolor text, backgrounds and components. Pages stay sharp, images stay exactly as you designed them, and your theme's own styles keep working. What it does Color controls Six built-in presets (Rose, Ocean Blue, Forest Green, Violet Purple, Amber Sunset, Slate Mono) fill every color control in one click, and every field stays editable afterwards — each field explains which parts of your site it affects. Full control over the dark palette from Settings → Mini Dark Mode: accent, links, headings, body text, borders, site and content backgrounds, plus a reference palette. Text that you colored inline with your accent color is kept in the accent color instead of being brightened. One option keeps in-content headings in your accent color for sites whose light theme already uses colored content headings. Fine-tuning A dedicated "Advanced tweaks" area for per-site fine-tuning: pick a target (site header, site footer, sidebar, post content, widgets, tables, form fields, blockquotes, code blocks, links), pick a property (background, text or border colour) and pick a colour. Every rule you add applies only while dark mode is on. Targets, properties and colours are each validated against a fixed list on save and re-checked on output, so the generated stylesheet can only ever contain the declarations the plugin itself defines. Accessibility The button is a real button element with aria-pressed state, a visible focus ring for keyboard users, and translated labels. No motion for reduced-motion users, no layout shifts, no autoplaying anything. Credits

安装:

  1. Upload the plugin to /wp-content/plugins/, or install the zip via Plugins → Add New.
  2. Activate.
  3. Configure colors and the button under Settings → Mini Dark Mode. That's it — no other setup.

屏幕截图:

  • The dark palette. Reference colors, theme colors (accent, links, headings, body text, borders) and surface colors, each with a per-field note explaining what it affects.
  • Advanced tweaks. Pick a target, a property and a color — no CSS needed, and only whitelisted values can be saved.
  • The same page in light and dark mode. Text, backgrounds and components recolor; images are left exactly as authored.

升级注意事项:

1.0 Initial release.

常见问题:

Does it dim or invert images?

No — that is the point. Filters over images make photos muddy and break galleries and maps. Mini Dark Mode only recolors text, backgrounds and interface components through CSS variables. Your images render exactly as authored.

Will there be a flash of light content before dark mode applies?

No. A tiny inline script in the page head applies the saved mode before the first paint.

Does it work with my theme?

The core mechanism (one class + CSS variables) works with any theme. Ships with tuned rules for Astra, Elementor, Spectra/UAGB, Visual Portfolio, MEC and wpDiscuz. Anything else can be adjusted with the colour controls and the Advanced tweaks area.

Can I place the toggle in my menu or a page?

Yes. Turn off the floating button in the settings and place the [minidarkmode] shortcode anywhere — menus, footers, Elementor shortcodes widget, etc.

Does it remember the visitor's choice?

Yes, per browser via localStorage. Visitors who never chose get their operating system's color scheme preference.

Can I style things myself?

Yes. While dark mode is on, the html element carries the class mdm-dark-mode and the attribute data-mdm-dark-mode="dark". Every colour is exposed as a CSS custom property: --mdm-accent, --mdm-link, --mdm-link-hover, --mdm-heading, --mdm-text, --mdm-border, --mdm-bg, --mdm-surface, plus the reference palette values --mdm-palette-*. The toggle button itself is .minidarkmode-toggle.

Does it affect wp-admin?

No. Mini Dark Mode is front-end only.

更新日志:

1.0