loading...

re: Name a tech you recently tried, but wasn't fully a fan of? VIEW POST

FULL DISCUSSION
 

css-in-js libraries

 

Just saved an article on it to explore the downsides more ;)

 

Would love to hear the "why" answer 😃

 

Probably because it is unnecessary overhead and it has no additional value, but it is "fancy".

Cannot disagree more 😃 Have you been working with these on a bigger-scale project? CSS-in-JS are a breeze in terms of development speed, code readability and maintenance, and are also a lot easier to optimize. Creating clean CSS, without much duplicate code and with some kind of organisation is a pretty hard task.

Also, when the - almost unnoticeable - overhead is a problem for you, you can always use some of the zero-runtime CSS-in-JS libraries.

 

Here are 4 "why" :

  • don't really see what problem(s) they solve
  • demo codes (most of the time) are not convincing, not focusing on real use cases, so it's not something you can use to teach code and as a result it's more difficult to justify CSS-In-Js for big projects with money at stake
  • don't see a lot of best practices
  • when dealing with components, CSS Modules are much better imho (maintenance, readability)

So most of the time it consists in pretty cool features but there are better techniques that bring better results and solve more problems.

Would love to know your point of view on those specific points. I'm not pretending that I have all the answers but I've some experience (perso and pro) with these libraries.

Code of Conduct Report abuse