-
Notifications
You must be signed in to change notification settings - Fork 4
Open
Labels
enhancementNew feature or requestNew feature or request
Description
It would be nice to have a function (provided through the let:
directive or as an accessor) to programmatically update the theme. This way, the consumer wouldn't need to maintain the theme
prop by themselves.
let:
directive
<DarkMode let:theme let:toggleTheme>
<button on:click={toggleTheme}>Toggle</button>
Current theme: {theme}
</DarkMode>
Accessor
<script>
let darkMode;
let theme;
</script>
<DarkMode bind:this={darkMode} bind:theme />
<button on:click={darkMode?.toggleTheme}>Toggle</button>
Current theme: {theme}
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request