
內容簡介
Mini Dark Mode 為您的網站添加了深色模式切換功能,透過簡單的 CSS 變數重新著色文本和背景,保持頁面清晰且不影響圖片設計,提供更佳的使用體驗。
【主要功能】
• 浮動切換按鈕或短碼可放置於任意位置
• 記住每位訪客的選擇於瀏覽器中
• 支援操作系統的顏色偏好設置
• 六種內建顏色預設可快速選擇
• 針對特定外掛提供專屬深色樣式
• 完全國際化,支援多語言翻譯
外掛標籤
開發者團隊
原文外掛簡介
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
Floating toggle button (bottom left or right) or a pill button with a text label — colors follow your accent color
[minidarkmode] shortcode to place the toggle anywhere (menu, footer, page builder) — turn the floating button off and use the shortcode alone if you prefer
Remembers each visitor’s choice in their browser (localStorage)
Falls back to the operating system preference (prefers-color-scheme) for first-time visitors, and follows OS changes live until the visitor picks a side
Applies the saved mode before first paint — no flash of light content
Optional keyboard shortcut: Ctrl+Alt+D
Optional transparent header in dark mode (works out of the box with Astra; includes the generic header class)
Elementor, Spectra (UAGB), Visual Portfolio, MEC events and wpDiscuz get dedicated dark styling
Respect for prefers-reduced-motion: transitions are disabled for visitors who ask for less motion
No dark mode is applied to the login page or wp-admin — front end only
Fully internationalized; translations are delivered through translate.wordpress.org
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
Inspired by WP Dark Mode by WPPOOL.
