fix(colorScheme): dispatch onColorSchemeChange at page load (#118)

This commit is contained in:
Jimmy Cai 2021-01-04 10:52:14 +01:00 committed by GitHub
parent 1ec73b2d76
commit 90e259f31e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -9,6 +9,8 @@ class StackColorScheme {
this.bindMatchMedia(); this.bindMatchMedia();
this.currentScheme = this.getSavedScheme(); this.currentScheme = this.getSavedScheme();
this.dispatchEvent(document.body.dataset.scheme as colorScheme);
if (toggleEl) if (toggleEl)
this.bindClick(toggleEl); this.bindClick(toggleEl);