JPeer264 / node-rcs-core

Rename css selectors across all files
MIT License
37 stars 7 forks source link

How to include class names containing colon #122

Closed david-szabo97 closed 3 years ago

david-szabo97 commented 3 years ago

How to include class names containing colon?

For example tailwind uses md: prefix for classes. How to make sure that md:flex is renamed?

JPeer264 commented 3 years ago

Hey @david-szabo97 , thanks for your issue. Back then I didn't thought this would be a valid use case, but ya there is definitely one. I will add this functionality asap

JPeer264 commented 3 years ago

@david-szabo97 ok seems like this issue came up in 2018 and has been tested (ref: https://github.com/JPeer264/node-rcs-core/issues/67). Can you tell me which version you use?

EDIT: And finally to answer your question. In css the colons should be prefixed like so:

.my\:colon-selector:after {}

This means then you can write following in HTML

<div class="my:colon-selector">
</div>
david-szabo97 commented 3 years ago

Sorry! It's my bad. Looks like purge-css removed all the classes containing colons. So I thought RCS is not working properly.

Thanks for the quick reply!

JPeer264 commented 3 years ago

No worries.

I bet it is also nice to work with the .statistics from rcs-core. We introduced a list of not used selectors here (https://github.com/JPeer264/node-rcs-core/blob/main/docs/api/statistics.md).