If I define a class with the special character ! in the name, purge css will always remove this class. For example, if I define my css class as:
.\!red-text {
color: #ff0000 !important;
}
And then my html looks like:
<div class="!red-text">Bla bla bla</div>
Then the !red-text class will be purged, even though this class is actively being used.
Note: I haven't tested any other special characters, but I assume they are working correctly because I am using tailwindcss and haven't noticed any other issues (Tailwind uses the special : character extensively in class names).
This is probably an issue with the regex pattern which is not accounting for the exclamation character. You can change this by using the extractorPattern option https://github.com/spatie/laravel-mix-purgecss#usage
If I define a class with the special character
!
in the name, purge css will always remove this class. For example, if I define my css class as:And then my html looks like:
Then the
!red-text
class will be purged, even though this class is actively being used.Note: I haven't tested any other special characters, but I assume they are working correctly because I am using tailwindcss and haven't noticed any other issues (Tailwind uses the special
:
character extensively in class names).