-
-
Notifications
You must be signed in to change notification settings - Fork 171
Add bundled v4 fallback #390
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
Conversation
f7fc236 to
827e5f2
Compare
7e55219 to
cb6a0f6
Compare
9bb8ae4 to
41c0449
Compare
| tailwindPackageName: 'tailwindcss-v4', | ||
| }) | ||
|
|
||
| expect(result).toEqual('<div class="group peer unknown-class container p-0"></div>') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't unknown-class exist before group and peer? 🤔
Because while group and peer don't exist, they are still more known than unknown classes.
I don't know if we test this already, but named group and peers should be in a similar position.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In v4 we don't sort group and peer though
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good (after you resolve the changelog conflict)
Breaking Change
We now fall back to v4 by default
Earlier versions of this plugin loaded a bundled version Tailwind CSS v3.x if no local install was found. This behavior remained even when you had configured the
tailwindStylesheetoption.We'll now intelligently load either v4 or v3 based on some rules which are outlined (approximately) below:
tailwindStylesheettailwindConfigtailwindStylesheettailwindConfigtailwindStylesheettailwindConfigNotably, you can always force v4 by providing a
tailwindStylesheetoption — regardless of your local Tailwind CSS version. The same goes for v3.x and an explicittailwindConfigoption. If both are provided a warning is printed and the stylesheet takes precedence (and thus v4 is loaded).If you do not provide a
tailwindStylesheetwhen running v4 this plugin will use the default theme. You must provide this option if you customize your theme, variants, utilities, plugins, etc… otherwise some classes may sort incorrectly.This bundles Tailwind CSS v4, it's relevant stylesheets, and intercepts their loading so users of the CDN or Standalone CLI can properly sort these without needing a local install through NPM.
This is a breaking change. We will still, however, search for a
tailwind.config.js(or similar) in this scenario and load a bundled version of v3 if we find one. Specifying a stylesheet will force the plugin to load a bundled version of v4 if no local install exists.Fixes #364