huseyinfiliz/simple-dark-mode
Composer 安装命令:
composer require huseyinfiliz/simple-dark-mode
包简介
A simple dark mode toggle for Flarum 2
README 文档
README
Simple Dark Mode
A simple dark mode toggle extension for Flarum 2.
Simple Dark Mode adds a quick theme toggle to your forum header, allowing users and guests to switch between light and dark mode without opening the full appearance settings.
Features
- 🌙 Quick theme toggle: Adds a simple light/dark mode button to the forum header.
- 👤 User preference support: Logged-in users keep their selected theme through Flarum preferences.
- 👥 Guest support: Guest users can also switch themes, with their choice stored locally in the browser.
- ♿ High contrast support: Preserves Flarum's high contrast modes when switching between light and dark.
- ⚙️ Admin settings: Control header visibility and icon style.
Installation
composer require huseyinfiliz/simple-dark-mode:"*"
php flarum cache:clear
Then enable the extension from your admin panel.
Updating
composer update huseyinfiliz/simple-dark-mode:"*"
php flarum cache:clear
Removing
composer remove huseyinfiliz/simple-dark-mode php flarum cache:clear
Notes
This extension is intentionally simple. It does not add a custom theme system; it uses Flarum's existing color scheme support and provides a faster way to switch between modes.
High contrast modes are preserved when toggling:
light -> dark
dark -> light
light-hc -> dark-hc
dark-hc -> light-hc
For guest users, the selected theme is stored in the browser. This means the preference may be cleared if the browser storage is cleared or when using private/incognito mode.
Links
If you liked this extension, don't forget to check out my other extensions too: huseyinfiliz.com/flarum
License
Released under the MIT License.
统计信息
- 总下载量: 0
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 2
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-07-08