From ba0ef374816604d24f8758973cb50b35c57ec910 Mon Sep 17 00:00:00 2001 From: Sodbileg Gansukh Date: Mon, 24 Feb 2025 14:30:31 +0800 Subject: [PATCH] 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 --- ghost/admin/app/services/feature.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ghost/admin/app/services/feature.js b/ghost/admin/app/services/feature.js index fadce04a39..d261c18e36 100644 --- a/ghost/admin/app/services/feature.js +++ b/ghost/admin/app/services/feature.js @@ -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);