[CSSReset] When resetCSS is false, Chakra is still overriding body styles
See original GitHub issue🐛 Bug report
I have resetCSS
set to false
in my chakra provider, but I’m still getting body
styles overridden by chakra.
💥 Steps to reproduce
- Set
resetCSS
tofalse
in the chakra provider. - Check the styling for a piece of text and see that it’s still getting body styling from chakra.
💻 Link to reproduction
Please create a minimal reproduction in CodeSandbox https://codesandbox.io/s/strange-dhawan-phri5?file=/src/App.tsx
🧐 Expected behavior
Either the body styles shouldn’t be overridden, or there should be a way to prevent this.
🌍 System information
Software | Version(s) |
---|---|
Chakra UI | 1.0.3 |
Browser | Chrome |
Operating System | MacOS |
📝 Additional information
Issue Analytics
- State:
- Created 3 years ago
- Reactions:4
- Comments:8 (4 by maintainers)
Top Results From Across the Web
I see, these global styles are set by default.
[CSSReset] When resetCSS is false, Chakra is still overriding body styles ... but I'm still getting body styles overridden by chakra.
Read more >reactjs - Markdown is not being displayed correctly due to ...
I solved the problem by adding the default CSS of HTML tags to the global styles in theme.js. But this feels like a...
Read more >Frontend Handbook | React / Chakra UI
Chakra factory will be defined with base style and can be overridden by sx prop because baseStyle is merged before sx .
Read more >Upgrading to v1
This is useful if you're not a fan of style props, and prefer passing all styles in ... CSSReset: To omit the recommended...
Read more >CSS Tip #1: Resetting Your Styles with CSS Reset
Reset CSS is the process of resetting the styles of all elements to a baseline value to avoid cross-browser differences. Learn more here!...
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
Agree with @nahumzs- my use case is to inject a chat component into existing web pages. So I’d like to restrict Chakra CSS to that component only.
I have been testing chackra in a prototype for some time now, I honestly can’t understand how a simple component like the
Box component
will inject so many global styles and resets, IMHOStyles
within the scope of a UI library should be agnostic and specific to the component that you want to use, having thisglobal
concept of styles plus forcing a reset in an application decrease heavily the chances for a serious application to adopt chackra partially.Pretty much at this point is all in with chakra you adopt it or you don’t, also even if you adopt it I can see many conflicts with third party components that you might want to use in your application, this can be brutal if you don’t have access to the styles for third party components. 😦
It would be great to have a function like:
And prevent this from happening.