fix(colorScheme): dispatch onColorSchemeChange at page load

This commit is contained in:
Jimmy Cai 2021-01-04 10:50:47 +01:00
parent 1ec73b2d76
commit d98776a013
No known key found for this signature in database
GPG Key ID: 3EA408E527F37B18

View File

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