-
Notifications
You must be signed in to change notification settings - Fork 4.5k
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
[v4] Tailwind CSS 4 ignores .vitepress directory and files #16050
Comments
Hey! Can you add a minimal reproduction GitHub repo so we can take a look? |
Maybe it already helps to link the "real thing". https://github.com/Vectrex/vxVue The outcome can be seen here https://vectrex.github.io/vxVue/accordion.html where for example the GUI elements are not styled. |
Hi, I'm also facing the same issue. Maybe it is because the dot in |
Seems to be more of a |
Seems to be the culprit. |
Yeah I've also seen elysiajs/documentation@52bdfdd#diff-05ed1c7f99e45b485708115502a1e0f28c8547e9a9a29c1b8664f79103cf7873 do the same |
@Vectrex I tried running your repo but I really don't know how to see the error here, there's too much going on here. What's missing the styles here? (I checked out the commit before your fix of changing to the postcss plugin, ![]() If you could recreate this in a minimal setup with only the essential files it would help a ton, not sure how we can help otherwise. |
The problem is visible once you run |
I've added a simple repo outlining the issue: https://github.com/Vectrex/tailwind4-test The initial commit uses the However, only the postcss version generates this class. Adding a |
Oh, I think I got it. So first of all it is expected that you have to add I was looking through your initial bug report again and you mentioned you added: @source './docs/**/*.md'; However, looking at the repo the CSS file is inside the @source '../docs/**/*.md'; |
Cheers to Vienna... Perhaps However, updating to the correct @source '../docs/**/*.md'; and switching back to the Vite plugin and adding a |
@Vectrex Yeah we updated the text recently and it now says 'relative to the stylesheet' but that wasn't there a couple of weeks ago for sure. Sorry about that! Oh this does seem unexpected but I agree that with the changes that we've made to the Vite plugin this will just work out-of-the-box now. Feel free to reopen though if you have any more issues! |
What version of Tailwind CSS are you using?
4.0.1
What build tool (or framework if it abstracts the build tool) are you using?
vite
What version of Node.js are you using?
22.13.1
What browser are you using?
Firefox
What operating system are you using?
Ubuntu 24.04.1
Describe your issue
With Tailwind 3.4.x I can incorporate Tailwind classes in my Vitepress markdown files. My tailwind.config.js looks like this
One of the markdown files contains a
and Vite delivers a stylesheet containing
When switching to Tailwind 4 the config file is gone.
Since the .vitepress directory and all its contents is not in a .gitignore all the markdown files should be parsed.
The CSS now looks like this
but the resulting CSS provided by Vite does not contain a
.bg-amber-900
class.Adding
doesn't change anything - the resulting CSS provided by Vite does not contain a
.bg-amber-900
class.package.json
vite.config.js
Expected behavior:
Tailwind 4.0 should also generate stylesheets containing classes used in Vitepress markdown files.
The text was updated successfully, but these errors were encountered: