diff --git a/components/dist/theme-toggle.js b/components/dist/theme-toggle.js index 393fb03..90e64ae 100644 --- a/components/dist/theme-toggle.js +++ b/components/dist/theme-toggle.js @@ -102,8 +102,15 @@ class ThemeToggle extends HTMLElement { } toggleState() { - this.toggleAttribute('checked'); - this.fireEvent(); + if (!document.startViewTransition) { + this.toggleAttribute('checked'); + this.fireEvent(); + return; + } + document.startViewTransition(() => { + this.toggleAttribute('checked'); + this.fireEvent(); + }); } handleKeyDown(e) { if (e.key === ' ') {