question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Tailwind v3 extractor

See original GitHub issue

Is 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).

image

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:4
  • Comments:9 (1 by maintainers)

github_iconTop GitHub Comments

3reactions
birtlescommented, Dec 10, 2021

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.)

1reaction
frederikhorscommented, Jun 10, 2022

Nope

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found