mirror of
https://github.com/CaiJimmy/hugo-theme-stack.git
synced 2024-11-23 10:21:46 +01:00
fix(colorScheme): dispatch onColorSchemeChange at page load (#118)
This commit is contained in:
parent
1ec73b2d76
commit
90e259f31e
1 changed files with 2 additions and 0 deletions
|
@ -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);
|
||||
|
||||
|
|
Loading…
Reference in a new issue