FIX: darkMode availiability detection was broken (#17207)

This regressed on 2f66eb5 where CSS was moved from the HTML document
head to the body.

Bug report at https://meta.discourse.org/t/-/230656?u=falco
This commit is contained in:
Rafael dos Santos Silva 2022-06-22 14:32:13 -03:00 committed by GitHub
parent 684bc821be
commit a0f3ec7b13
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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";