Tailwind v3 extractor
See original GitHub issueIs your feature request related to a problem? Please describe. Now that Tailwind 3 is really close I think we should update Docs for a custom Tailwind extractor that works.
Describe the solution you’d like With Tailwind 2 we could have used a default extractor that they made available in an internal file, but it was not a public API and in fact it is gone now: https://github.com/tailwindlabs/tailwindcss/discussions/6162.
What to do with Tailwind 3?
Using extractor copied from Tailwind internals changes code from this:
*,
:after,
:before {
border: 0 solid;
box-sizing: border-box;
}
:after,
:before {
--tw-content: "";
}
to this
* {
border: 0 solid;
box-sizing: border-box;
}
which is totally wrong (especially for Tailwind 3).
Issue Analytics
- State:
- Created 2 years ago
- Reactions:4
- Comments:9 (1 by maintainers)
Top Results From Across the Web
What to use as PurgeCSS extractor for Tailwind 3?
What to use as PurgeCSS extractor for Tailwind 3? With Tailwind 2 we could have used a default extractor that they made available...
Read more >Upgrade Guide - Tailwind CSS
Upgrading your Tailwind CSS projects from v2 to v3. Tailwind CSS v3.0 is a major update to the framework with a brand new...
Read more >Install Tailwind CSS v3 - CDN vs CLI vs PostCSS - YouTube
Tailwind CSS released it's major version 3.0 on December 9th. If you're new to Tailwind or front end development, you might wonder how...
Read more >Tailwind CSS from Zero to Hero - Extracting Components and ...
<a class="flex items-center justify-center px-8 py-3 font-medium rounded-md text-white ... Enter component extraction in Tailwind CSS.
Read more >Extracting TailwindCSS from HTML - DevDojo
Page with inline Tailwind Classes. To extract the classes I want to use, I will first need to install the PurgeCSS CLI: npm...
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
I’ve also noticed that the default extractor doesn’t work for Tailwind’s “arbitrary values” syntax.
e.g. if I have
text-[10px]
, it ends up getting stripped.(For what it’s worth,
defaultExtractor: (content) => content.match(/[\w-/:[\]]+(?<!:)/g) || [],
did the trick for me for the arbitrary values issue.)Nope