-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
CSS @layer primereact
is not working with Bootstrap/MUI
#5124
Comments
Assigned to PrimeTek. |
I use primereact in an app that also uses Bootstrap, when upgrading to version 10.0.2 the styles are breaking because Bootstrap styles are taking precedence over the PrimeReact theme. |
Bootstrap instructions: https://primereact.org/bootstrap/ |
@melloware @kabalan-datapostie This solution does not solve my problem. |
can you put together a Stackblitz showing your issue @yrios-cdd ? |
I agree with @yrios-cdd - the use case here is that we want to use PrimeReact themes (in my case for instance If I understand correctly, https://primereact.org/bootstrap/ fulfills the opposite case: where we want to use the theming of the external libraries, and have them take precedence over PrimeReact unstyled. So the reproducer above stays valid: https://codesandbox.io/s/primereact-test-forked-hc22hc?file=/src/index.js |
@melloware The one shown by @kabalan-datapostie is valid, only this one installs and imports Bootstrap and in my case Bootstrap is loaded separately in the app layout template using |
Yep I see it I think I will rename this ticket to Bootstrap specifically as Bootstrap does not appear to support |
@layer primereact
is not working with Boostrap
@layer primereact
is not working with Boostrap@layer primereact
is not working with Bootstrap
@layer primereact
is not working with Bootstrap@layer primereact
is not working with Bootstrap/MUI
Any estimate of when a solution to this problem might be released? |
From Optimus on Discord: https://discord.com/channels/787967399105134612/787968635414118421/1205480133855678524
|
Describe the bug
Use case: PrimeReact is a fantastic theme and component library. Other CSS toolkits (e.g. Bootstrap, Tailwind, Materialize, etc.) provide useful utilities on top of it like grid, spacing, and much more. So, it's a common use case to use themed PrimeReact with these other "utility" CSS libraries, and want PrimeReact to take precedence over these utility libraries.
The problem: this use to work well. However, PrimeReact 10.x removed the "core" PrimeReact library in favour of only needing to import the style library, and added layers to the themed libraries. These layers mean that the other utility libraries (Bootstrap etc.) now take precedence over core PrimeReact classes.
Potential solutions:
@layer primereact
when working with the unstyled version of PrimeReact.@layer
Note: this issue is related to issue #4987, but the conversation veered more towards unstyled PrimeReact and specific to Tailwind, whereas this is a more ubiquitous issue caused by layers in 10.x that other commenters in that issue have mentioned.
Reproducer
https://codesandbox.io/s/primereact-test-forked-hc22hc?file=/src/index.js
PrimeReact version
10.0.5
React version
18.x
Language
ES6
Build / Runtime
Next.js
Browser(s)
Chrome 118
Steps to reproduce the behavior
See reproducer
Expected behavior
See reproducer and use case in bug description
The text was updated successfully, but these errors were encountered: