Closed ezsper closed 5 years ago
You can use function values for dynamic styles, they are updating cssom rules in JSS as opposed to creating new once in other cssinjs libs.
Additionally you can use sheet.getRule(name).toJSON() which can be applied to style property on nodes, but I don't see the point of using it if you can have fast dynamic rendering while keeping all styling in one place in the style sheet.
That being said, I am working on such an interface, but it's not released officially yet. https://github.com/cssinjs/jss/blob/master/packages/css-jss
A function
css(element, cssProperties)
that can reuse JSS plugins to create inline styles. This is particularly good for dynamic Javascript styles like positioning and animations.I have seen some components using dependencies like dom-css.
It would be good a function like this so we could be using the same CSS generation API that is consistent with the ones on stylesheet.