Mô tả
ZeroBloat Dark Mode adds a floating toggle button that lets visitors switch between light and dark mode.
No settings page. No database queries. No bloat.
Just install, activate, done.
Features
- Floating toggle button (bottom-right corner)
- Respects system preference (prefers-color-scheme)
- Remembers user choice (localStorage)
- Prevents flash of unstyled content
- Shortcode
[dark_mode_toggle]for custom placement - Works with any theme
- No external dependencies
- No tracking or analytics
- Under 5KB total
How It Works
- Checks user’s saved preference
- Falls back to system preference (OS dark mode)
- User can toggle anytime with the floating button
- Choice is saved for future visits
Styling
The plugin applies sensible dark mode defaults. To customize, add CSS to your theme:
body.mdm-dark {
background-color: #121212 !important;
color: #ffffff !important;
}
Cài đặt
- Upload the
zerobloat-dark-modefolder to/wp-content/plugins/ - Activate through the ‘Plugins’ menu
- Done. A toggle button appears on your site.
Hỏi đáp
-
Where are the settings?
-
There are none. The plugin uses sensible defaults. If you need customization, add CSS to your theme.
-
Use the shortcode
[dark_mode_toggle]to place it anywhere. The floating button will still appear unless you hide it with CSS:.mdm-toggle:not(.mdm-toggle-inline) { display: none !important; } -
Does it work with my theme?
-
It works with most themes. Dark mode is applied using CSS with
!importantrules to override theme styles. -
Can I customize the colors?
-
Yes, add CSS to your theme targeting
body.mdm-dark. See the Styling section above. -
Does it remember the user’s choice?
-
Yes, it saves the preference in localStorage and restores it on next visit.
-
Does it respect system dark mode?
-
Yes, if the user hasn’t made a choice, it follows the OS preference.
Đánh giá
Không có đánh giá nào cho plugin này.
Người đóng góp & Lập trình viên
“ZeroBloat Dark Mode” là mã nguồn mở. Những người sau đã đóng góp vào plugin này.
Những người đóng gópDịch “ZeroBloat Dark Mode” sang ngôn ngữ của bạn.
Muốn tham gia phát triển?
Duyệt code, check out SVN repository, hoặc theo dõi nhật ký phát triển qua RSS.
Nhật ký thay đổi
1.0.0
- Initial release