Currently, It's really hard to bubble events and pass styles to svelte:component
.
This is because, use
directive works only for elements and as such, bubbling events wouldn't work.
Passing styles around too is difficult since use:chakra
is not allowed either. For many months, I thought on how this can be achieved. And after so long, I got it finally.
This PR adds a wrap
prop which allows svelte:component
to be wrapped with an element of choice. This element would in turn receive all styles and events.
It also adds one more thing. It creates styles and passes its as a class to the underlying component.
This way, it's easier to simply decide not to use wrap