0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-03-11 02:12:21 -05:00

Fixed the initial state of the dark mode (#22265)

no issues

- when nightShift doesn't exist in the db, it defaulted to dark mode by
default
- this changes the initial state to light by default
This commit is contained in:
Sodbileg Gansukh 2025-02-24 14:30:31 +08:00 committed by GitHub
parent 0d5228fc70
commit ba0ef37481
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -152,7 +152,7 @@ export default class FeatureService extends Service {
nightShift = enabled || this.nightShift;
}
document.documentElement.classList.toggle('dark', nightShift);
document.documentElement.classList.toggle('dark', nightShift ?? false);
return this.lazyLoader.loadStyle('dark', 'assets/ghost-dark.css', true).then(() => {
$('link[title=dark]').prop('disabled', !nightShift);