isolate styles to reduce collisions
See original GitHub issueIs your feature request related to a problem? Please describe.
When using Hope UI in parallel with other components, the other components are affected by Hope UI’s global CSS reset, even if they are not directly wrapped with <HopeProvider>
.
Describe the solution you’d like
Apply the CSS reset starting from a .hope-root
container (or something similar), rather than the document root.
For example, Svelte Materialify implements this to some degree and applies most of its styles starting at .s-app
; and there can be multiple .s-app
roots.
Issue Analytics
- State:
- Created a year ago
- Comments:7
Top Results From Across the Web
How to isolate component styles in React using CSS modules
How to isolate component styles in React using CSS modules ... and you need to work harder to prevent collisions between components styles....
Read more >isolation - CSS: Cascading Style Sheets - MDN Web Docs
The isolation CSS property determines whether an element must create a new stacking context.
Read more >How to isolate component styles in React using CSS modules
When using a separate style file, by default, all styles are global, as demonstrated later in this post, and you need to work...
Read more >How to isolate my javascript code to prevent collisions?
You are headed in the right direction. You can use the module pattern to create an object with private members and methods like...
Read more >ASP.NET Core Blazor CSS isolation - Microsoft Learn
Isolate CSS styles to individual pages, views, and components to reduce or avoid: Dependencies on global styles that can be challenging to ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This is possible, however this will require
<HopeProvider>
to render an extradiv
element to apply the.hope-root
class.That seems like a pretty good implementation 👍
Just checked out how the CSS was being implemented and saw that you’re using
stitches
, which I’m not familiar with. Is this something that can be overcome with their style API?