When I use a ref, I most often also want to get a handle to it with css, which leads to slightly annoying, duplicative markup.
<style>
.container {
color: red
}
</style>
<div class="container" ref:container></div>
The only solutions I can think of to mitigate this are untenable, but thought I raise this if others see something better.
- Make nodes with ids available as refs, like polymer's static node map
- Make svelte refs available as synthetic css selectors
- Make a syntax shortcut for declaring refs as classes, e.g.
<div ref:class:container ></div>
When I use a ref, I most often also want to get a handle to it with css, which leads to slightly annoying, duplicative markup.
The only solutions I can think of to mitigate this are untenable, but thought I raise this if others see something better.
<div ref:class:container ></div>