We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0fb25c8 commit 245b0f2Copy full SHA for 245b0f2
assets/ts/colorScheme.ts
@@ -8,6 +8,10 @@ class StackColorScheme {
8
constructor(toggleEl: HTMLElement) {
9
this.bindMatchMedia();
10
this.currentScheme = this.getSavedScheme();
11
+ if (window.matchMedia('(prefers-color-scheme: dark)').matches === true)
12
+ this.systemPreferScheme = 'dark'
13
+ else
14
+ this.systemPreferScheme = 'light';
15
16
this.dispatchEvent(document.documentElement.dataset.scheme as colorScheme);
17
0 commit comments