Skip to content

[docs] Add Tailwind CSS v4 integration guide #45906

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

Merged
merged 22 commits into from
Apr 22, 2025

Conversation

siriwatknp
Copy link
Member

@siriwatknp siriwatknp commented Apr 14, 2025

closes #44700

Docs: https://deploy-preview-45906--material-ui.netlify.app/material-ui/integrations/tailwindcss/tailwindcss-v4/

  • Added v3 to the guide in "Style library interoperability" section
  • Added a dedicated page for Tailwind v4 integration.

Try it out


@siriwatknp siriwatknp added the docs Improvements or additions to the documentation label Apr 14, 2025
@@ -18,7 +18,7 @@ export const replaceMaterialLinks = (url: string) => {
return url;
}
return url.replace(
/(guides|customization|getting-started|discover-more|experimental-api|migration)/,
/(guides|customization|getting-started|discover-more|experimental-api|migration|integrations)/,
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add this change to fix the wrong generated url of the deploy preview

image

In the image above, the material should be material-ui.

@mui mui deleted a comment from mui-bot Apr 14, 2025
@mui-bot
Copy link

mui-bot commented Apr 14, 2025

@siriwatknp siriwatknp marked this pull request as ready for review April 14, 2025 07:48
@siriwatknp siriwatknp requested a review from mnajdova April 14, 2025 11:40
@import 'tailwindcss';
```

### Next.js Pages Router
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I couldn't make this work, I tried to follow the steps from the Next.js guide and this one, but Tailwind classes were not overriding the MUI styles. It would be great if we can have an example to link (together with the guides), as combining the two guides it's kind of hard to follow.

Also, I've created #45922 with bunch of issues I found on the Next.js guide.

Copy link
Member Author

@siriwatknp siriwatknp Apr 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is expected because we haven't release #45596.

Updated the PR description to make it clear what build to use.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, ok, I will update my testing app to use the build from that PR.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doc as a whole is very outdated and needs some serious reworking, possibly to split it up into multiple docs. As a start, what do you think about moving the Tailwind v3 info into the new v4 doc and making that the single source of truth for all Tailwind integrations? (That could also be a separate PR so we don't block this one.)

Copy link
Member Author

@siriwatknp siriwatknp Apr 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That could also be a separate PR so we don't block this one.

Totally agree, that's what I think.

However, I lean toward splitting v4 from v3 because the setup is quite different.
Also, I want to leave v3 integration as a separate page because the integration is such painful (we can't do anything about it because of the technical limitation), so in v3 page there should be an info to recommend Tailwind CSS v4 instead.

@siriwatknp siriwatknp force-pushed the docs/tailwind-integration branch from 2cebe0d to 6784999 Compare April 21, 2025 02:48
Copy link
Contributor

@mapache-salvaje mapache-salvaje left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

docs look good to me!

@siriwatknp siriwatknp merged commit f0dfbae into mui:master Apr 22, 2025
24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Improvements or additions to the documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[material-ui] Opt-in support for @layer to fix Tailwind v4 integration
4 participants