DEV Community

Discussion on: Set CSS styles with javascript

Collapse
 
codemilli profile image
Jooyoung Moon

Hi :D
I just wondered if using insertRule for performance or not and I found this article. Thanks !

But how it differ?

Collapse
 
karataev profile image
Eugene Karataev

I don't think you ever need to use insertRule in your day-to-day job unless you hit some performance bottleneck when working with styles.
I think optimizations with insertRule are useful for libraries (like styled-components), but add unnecessary complexity when developing regular websites or apps.