We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ae25694 commit af58f09Copy full SHA for af58f09
1 file changed
src/layouts/BaseLayout.astro
@@ -24,7 +24,6 @@ const pathname = Astro.url.pathname;
24
: 'light';
25
};
26
const isDark = getThemePreference() === 'dark';
27
- document.documentElement.classList[isDark ? 'add' : 'remove']('dark');
28
29
if (typeof localStorage !== 'undefined') {
30
const observer = new MutationObserver(() => {
@@ -36,6 +35,8 @@ const pathname = Astro.url.pathname;
36
35
attributeFilter: ['class'],
37
});
38
}
+
39
+ document.documentElement.classList[isDark ? 'add' : 'remove']('dark');
40
</script>
41
42
<html lang="en">
0 commit comments