Open Laityned opened 9 months ago
Thanks for reporting this @Laityned! We need to update the "Style library interoperability" doc to include instructions for using Tailwind CSS with the Next.js App Router.
Hello, I found this issue because I developed my entire project using Tailwind and MaterialUI, and it was at build time that I realised that there were differences between the build version and the development version. I finally realised that this was due to the combination of MaterialUI and Tailwind.
I'm using NextJS 14 with an app router, and given the changes to be made in the documentation, I don't know what to do to solve my problem.
I tried to do this:
Have I misunderstood, and can I only use the preflight of one or the other in the build version? In which case I have to change the style of my entire project again? Or have I misunderstood something else?
Perhaps you have an example project? Thank you very much for your help ! :)
Does this example help short out your problem?
Does this example help short out your problem?
Yes, thank you, I've been able to solve the problem. I've also better understood the value of preflights and made the necessary configurations to transpose my project more easily. Thanks a lot!
There's another point that could be made clearer in the docs regarding integration with Next.js. If one uses the enableCssLayer: true
option explained in MUI integration with Next.js do we still need to use the <StyledEngineProvider injectFirst>...
mentioned in step 4 in MUI integration with TailwindCSS ?
Related page
https://mui.com/material-ui/guides/interoperability/#tailwind-css
Kind of issue
Unclear explanations
Issue description
I was looking for how to integrate material-ui together with nextjs 14 app router and tailwind and it appears that following the guide does not results in a working configuration. Step three tells you to add the important option using the id of your app wrapper:
The #__next id is only valid for the page router of Nextjs. It is not present in the app router. There is no element at all with an id, so people should insert this them self in their root layout
Context 🔦
No response
Search keywords: interoperability nextjs tailwind app router