Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PurgeCSS wrongly removes all Tailwind-style colon classes #696

Open
timjuedemann opened this issue Aug 4, 2022 · 3 comments
Open

PurgeCSS wrongly removes all Tailwind-style colon classes #696

timjuedemann opened this issue Aug 4, 2022 · 3 comments

Comments

@timjuedemann
Copy link

timjuedemann commented Aug 4, 2022

Quick, short summary:
PurgeCSS wrongly removes all classes containing the colon character (i.e. md:w-6) despite them being in use. Could this be due to the colon character being escaped in the actual stylesheet (i.e. .md\:w-6)?

Expected results:
PurgeCSS removes only the colon classes not used in the scanned content.

Actual results:
PurgeCSS removes all colon classes regardless if they’re being used or not.

Exact steps to reproduce:

  1. Add colon classes in SCSS (they compile correctly when PurgeCSS is deactivated)
  2. Assign colon classes to content (PHP in my case)
  3. Compile with PurgeCSS activated
  4. PurgeCSS removes all colon classes despite some of them having been assigned in the content. Non-colon classes are removed correctly/as expected.

Your configuration (any details about your system that you think might be relevant)
CodeKit 3.16.1

@bdkjones
Copy link
Owner

bdkjones commented Aug 4, 2022

This sounds like a PurgeCSS issue. But regardless, Tailwind no longer uses PurgeCSS; the JIT Tailwind compiler assembles only the CSS you need. As long as you've installed the latest version of Tailwind, you're using the JIT approach and should not have PurgeCSS enabled.

@timjuedemann
Copy link
Author

Sorry, my wording might have been somewhat imprecise there – I am not actually using Tailwind but creating utility classes mimicking the Tailwind syntax.
That being said, I came across this thread offering a solution. Is it possible to point the PurgeCSS version that ships with CodeKit to a custom config file?

@marcomourao
Copy link

I would also love the possibility to use a custom config file or at least a field to just put the regex for a custom extractor.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants