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

Tailwind CSS v4.0 support #104

Open
rickyzhangca opened this issue Nov 22, 2024 · 4 comments · May be fixed by #105
Open

Tailwind CSS v4.0 support #104

rickyzhangca opened this issue Nov 22, 2024 · 4 comments · May be fixed by #105

Comments

@rickyzhangca
Copy link

rickyzhangca commented Nov 22, 2024

with the Tailwind CSS v4.0 beta, this error is given regardless of using the config file or the new CSS-first approach to import this plugin, appreciate anyone could take a look!

[plugin:@tailwindcss/vite:generate:serve] Package subpath './lib/util/flattenColorPalette' is not defined by "exports" in /Users/.../Documents/.../node_modules/.pnpm/tailwind-scrollbar@3.1.0_tailwindcss@4.0.0-beta.1/node_modules/tailwindcss/package.json
@rickyzhangca
Copy link
Author

rickyzhangca commented Dec 15, 2024

tailwindlabs/tailwindcss#15318 this should fix the bug, needs to confirm once it's out

@mst-mkt
Copy link

mst-mkt commented Dec 15, 2024

tailwindlabs/tailwindcss#15318 this should fix the bug, needs to confirm once it's out

This error is resolved at tailwindcss@4.0.0-beta.7, but at the same time the following different errors occur

Package subpath './lib/util/toColorValue' is not defined by "exports" in repo/node_modules/.pnpm/tailwind-scrollbar@3.1.0_tailwindcss@4.0.0-beta.7/node_modules/tailwindcss/package.json

This toColorValue function does not exist in the tailwind v4 code, so it may need to be addressed on the tailwind-scrollbar side

@mst-mkt mst-mkt linked a pull request Dec 15, 2024 that will close this issue
@rickyzhangca
Copy link
Author

thanks!

@adoxography
Copy link
Owner

adoxography commented Dec 16, 2024

So, for full transparency here, I'm going to drag my heels on officially supporting v4 until I can get the package's test suite running using their new architecture. The way Tailwind is actually invoked has changed in v4 (i.e. it's not just a postcss plugin anymore), and that means that none of the tests are presently able to run.

Although it may seem like a simple little plugin, it's shockingly difficult to target pseudoclasses of pseudoelements (think ::-webkit-scrollbar-thumb:hover) in Tailwind. As a result, this plugin has to do some manipulation on the postcss AST that Tailwind generates, and that's a little dangerous; it's easy to create scenarios like #101 where that manipulation inadvertently messes up the CSS output from completely unrelated packages. I have tests in the test suite that should prevent any regressions, and I want confirmation from them before I go about releasing anything. Additionally, I'm not even sure that the approach the package uses will work at all in the new architecture, which could require a partial rewrite.

I'll finally have some down time at work this month, so I'm hoping to find time to do some reading on how the authors intend Tailwind to be invoked now

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

Successfully merging a pull request may close this issue.

3 participants