It seems like it is impossible to safelist some TailwindCSS classes properly
See original GitHub issueHello!
It seems like it is impossible to safelist some TailwindCSS classes properly, for example:
safelist: ['px-6', 'py-6', 'px-16', 'py-8', 'm-4', 'm-3', '-mt-32', 'pb-8', 'h-3', 'pt-12', 'h-32', '-mt-10', 'md:mt-4', 'ml-20', 'mt-16', 'mt-0', 'mt-8', 'ml-2', 'w-3/12', 'w-4/12', 'w-2/12', 'ml-8', 'ml-12']
It doesn’t safelist some classes like w-3/12, w-2/12 etc.
“tailwindcss”: “^2.0.1” “@fullhuman/postcss-purgecss”: “^3.0.0”
Issue Analytics
- State:
- Created 3 years ago
- Comments:6
Top Results From Across the Web
PurgeCSS doesn't safelist properly · Discussion #2961 - GitHub
PurgeCSS doesn't safelist properly. ... It seems like it is impossible to safelist some TailwindCSS classes properly, for example:
Read more >Content Configuration - Tailwind CSS
The blocklist option only affects CSS that would be generated by Tailwind, not custom CSS you've authored yourself or are importing from another...
Read more >Why are some Tailwind classes not having effect in JetStream?
There are plenty of possibilities which may cause this, but as a kind of a workaround you could use the safelist ...
Read more >Upgrading to Tailwind CSS v3.0 - YouTube
In this video, I'll walk you through the most important steps when upgrading an existing project to Tailwind CSS v3.0.
Read more >eslint-plugin-tailwindcss - npm
eslint-plugin-tailwindcss · Compatible with Tailwind CSS v3 and v2 · Make sure to use the correct version · We need you ❤️ ·...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
anyone who came after looking for fix, use
inside your purgecss.config.js
There’s actually some published extractors, as well as more detailed documentation.
In my own case I’m using nuxt / vue & pug, so the class attribute in templates can end up being a bit of a mess, like this:
I modified the published purgecss-from-pug extractor and I’m using this: