Merge branch 'master' into canary

This commit is contained in:
Jimmy Cai
2024-10-19 21:38:02 +00:00
5 changed files with 22 additions and 3 deletions
+4
View File
@@ -8,6 +8,10 @@ class StackColorScheme {
constructor(toggleEl: HTMLElement) {
this.bindMatchMedia();
this.currentScheme = this.getSavedScheme();
if (window.matchMedia('(prefers-color-scheme: dark)').matches === true)
this.systemPreferScheme = 'dark'
else
this.systemPreferScheme = 'light';
this.dispatchEvent(document.documentElement.dataset.scheme as colorScheme);