Replies: 1 comment
-
I don't think I am ever going to implement it in cssnano. The main reason is that the usage would be completely different than with current cssnano, as you would need to also process the HTML to replace the class names somehow. On top of that, I doubt you could re-use much of the current code, you might as well start another project from scratch. I think that most libraries that do this are CSS in JS because of the need to change the HTML, for example https://github.com/atlassian-labs/compiled and https://github.com/callstack/linaria#features but I remember reading a lot of problems in their issues, it's really hard to ensure the transformed CSS is equivalent, but it was some time ago, maybe they've found a good algorithm in the mean time. |
Beta Was this translation helpful? Give feedback.
-
I had this idea and it was already built in 2016, predating tailwind: split all declarations into individual rules so you get atomic CSS and every rule only appears once.
https://github.com/sndrs/postcss-atomised/blob/master/README.md
What do we think about this approach?
Beta Was this translation helpful? Give feedback.
All reactions