diff --git a/app/assets/javascripts/discourse/app/pre-initializers/discourse-bootstrap.js b/app/assets/javascripts/discourse/app/pre-initializers/discourse-bootstrap.js index 17de813fe6e..78b9dc698d2 100644 --- a/app/assets/javascripts/discourse/app/pre-initializers/discourse-bootstrap.js +++ b/app/assets/javascripts/discourse/app/pre-initializers/discourse-bootstrap.js @@ -70,9 +70,8 @@ export default { } session.darkModeAvailable = - document.head.querySelectorAll( - 'link[media="(prefers-color-scheme: dark)"]' - ).length > 0; + document.querySelectorAll('link[media="(prefers-color-scheme: dark)"]') + .length > 0; session.defaultColorSchemeIsDark = setupData.colorSchemeIsDark === "true";