-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
[4 alpha] breaks the default Vite url(...)
references in imported CSS files.
#14784
Comments
@slavarazum Thanks for the report! We'll look into it. You can work around this for now by using the |
Wow, Tailwind team are really quick nowdays :) |
Fixes #14784 This is an alternative to #14850 in which we actually perform url rewriting / rebasing ourselves. We ported a large portion of the URL-rewriting code from Vite (with attribution) to use here with some minor modifications. We've added test cases for the url rewriting so verifying individual cases is easy. We also wrote integration tests for Vite that use PostCSS and Lightning CSS that verify that files are found and inlined or relocated/renamed as necessary. We also did some manual testing in the Playground to verify that this works as expected across several CSS files and directories which you can see a screenshot from here: <img width="1344" alt="Screenshot 2024-11-05 at 10 25 16" src="https://github.com/user-attachments/assets/ff0b3ac8-cdc9-4e26-af79-36396a5b77b9"> --------- Co-authored-by: Philipp Spiess <hello@philippspiess.com>
@slavarazum Hey! We just merged a fix for this which will be part of the next alpha release. Thanks again for reporting this and please let us know if you have any more issues 🙂 |
What version of Tailwind CSS are you using?
For example: alpha.29 (latest)
What build tool (or framework if it abstracts the build tool) are you using?
For example: Vite 5.4.10 (latest)
What version of Node.js are you using?
For example: v20.9.0
What browser are you using?
Mainly Safari, however it's not related to the issue 🙃
What operating system are you using?
MacOS
Reproduction URL
https://github.com/slavarazum/tailwind4-alpha-vite/
Describe your issue
Vite provides @import inline and rebasing for CSS.
I'm trying to import font from the Fontsource library: https://fontsource.org/fonts/nunito which references font files using
url(...)
.As a result we have such rebased urls:

After installing Tailwind, importing it, and enabling the Vite plugin, the URLs remain with the default related paths:

The text was updated successfully, but these errors were encountered: