sndyuk/mangle-css-class-webpack-plugin

Handling escaped characters in class names (contained in css files)

DamianGlowala opened this issue · 1 comments

@sndyuk Hey man :)

Thank you for a great piece of work - that's the library I was looking for. I got only one issue so far (minor and major at the same time) which I thought would be good to share and get your opinion on it:

I have spent so many hours on one single TailwindCSS class which I couldn't get to work: .tw-translate-y-1/2. This is how obviously I am writing it in my codebase. To my surprise, I never got it to mangle correctly. It indeed was replaced with a mangled version, but it had no actual css property behind. I didn't know classes like these should be escaped and thus why in Tailwind-generated file we have .tw-translate-y-1\/2 instead.

Do you think that escaping such characters from .css files could be a default behaviour of this webpack plugin? At the moment it all leads to the conclusion that these two classes (in the end equal) are treated by the plugin as different ones.

Literally found this gem now in the list of closed issues, closing this one as well :) I wish I had found it earlier! It indeed should be a part of official docs haha

#6 (comment)