-
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Closed
Description
This is a short example (this do not work in svelte)
<script>
export var color = '#000'
</script>
<style>
button {
background-color: {color}
}
</style>
<button><slot/></button>
What if...
svelte compiler could detect a style with {color}
and remove this from generated STATIC css
But instead this lines goes to a DYNAMIC css class
Here some js ideas:
https://stackoverflow.com/questions/1720320/how-to-dynamically-create-css-class-in-javascript-and-apply
And when color value changes, we could update dynamic class
Metadata
Metadata
Assignees
Labels
No labels