▲ | VPenkov a day ago | |
I'm really not a fan of CSS in JS, however it does have it's use-cases. Class mangling is very convenient with it and allows you to be prescriptive about how you're doing theming support, which is great when building libraries that 3rd parties embed on their websites. The trade-off is that of course your customers can't style things you haven't anticipated, but it means you can control what changes are breaking. And you can always add an extra variable in a new version if a customer wants to change a border color. | ||
▲ | lloydatkinson 5 hours ago | parent [-] | |
vanilla-extract accommodates this by having an API you can use at runtime if you really really want, to allow for CSS variables, which the user could then use. |