Skip to content

Commit 8c3082b

Browse files
committed
Extract element name as a constant
1 parent e961a65 commit 8c3082b

File tree

3 files changed

+9
-8
lines changed

3 files changed

+9
-8
lines changed

theme-switch.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@
9797
* - https://github.com/floating-ui/floating-ui
9898
* */
9999

100+
const ELEMENT_NAME = "theme-switch";
100101
const ICON_SIZE = 24 /* px */;
101102
const ICON_COLOR = "#000";
102103
const THEME_KEY = "theme";
@@ -281,7 +282,7 @@ function generateStyle() {
281282
}
282283

283284
updateTheme();
284-
window.customElements.define("theme-switch", ThemeSwitchElement);
285+
window.customElements.define(ELEMENT_NAME, ThemeSwitchElement);
285286
window
286287
.matchMedia(COLOR_SCHEME_DARK)
287288
.addEventListener("change", updateTheme);

theme-switch.min.js

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)