nightmode
nightmode copied to clipboard
Add classes to body for dark and light mode targeting
Fixes #77
Changes proposed in this pull request:
- Added
fof-DarkModeandfof-LightModeclasses to the<body>tag when switching themes in theswitchTheme.tsfile. - This change allows for better targeting of styles specific to dark and light modes, improving readability and user experience.
Reviewers should focus on:
- The logic for adding and removing classes from the
<body>tag. - Ensuring that the changes do not affect existing functionality.
- Feedback on whether the class names align with the project's naming conventions.
Confirmed
- [x] Frontend changes: tested on a local Flarum installation.
- [ ] Backend changes: tests are green (run
composer test).
Haven't tested this, but it'd probably need to be set in setTheme instead.
However, I think it's best not to bother as
- this is already possible to do with LESS variables (https://discuss.flarum.org/d/21492-friendsofflarum-night-mode/405)
- auto night mode will be built in for Flarum 2.0 once that is released
Since it is already possible to target the styles, I don't think this is necessary.