adamgian / minify-selectors

Post-processor to minify class and ID selector names.
Apache License 2.0
8 stars 0 forks source link

Need to accept invalid CSS characters as part of selectors in HTML attribute token strings #31

Closed adamgian closed 1 year ago

adamgian commented 1 year ago

For example:

<div class="md:p-8 text-center md:text-left"></div>
<style>
    .md\:p-8 {}
    .md\:text-left {}
</style>

While the colon is not a valid CSS char, it can be escaped in CSS so it can be used. The above class attribute should be transformed correctly into:

<div class="a b c"></div>
<style>
    .a {}
    .c {}
</style>