Skip to content
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

how to scope library styles to avoid affecting global css? #10

Open
adirzoari opened this issue Nov 29, 2024 · 0 comments
Open

how to scope library styles to avoid affecting global css? #10

adirzoari opened this issue Nov 29, 2024 · 0 comments

Comments

@adirzoari
Copy link

Hello,

I’m working on a project using my own UI kit components (built on PrimeReact). I want to include the styles from the library, but I’d like to restrict their scope so they apply only to the preview of my components.

Currently, if I include the styles in the index.css of my app, they affect the entire application and conflict with Tailwind, causing layout issues, which is not the desired behavior.

Is there a way to inject these styles specifically into the builder or preview environment without affecting the global CSS of the entire page layout?

For example, when I add my UI kit styles, the layout of the editor breaks:
Screenshot 2024-11-29 at 14 21 23

But if I don’t add my UI kit styles, the preview doesn’t render correctly:
Screenshot 2024-11-29 at 14 21 14

Any guidance or recommendations on how to resolve this would be greatly appreciated!

Thank you!

@adirzoari adirzoari changed the title How to Add Styles from the Library Without Affecting Global CSS? how to scope library styles to avoid affecting global css? Nov 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant