-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
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
[CssBaseline] Allow css baseline to be restricted to a div #19657
Comments
@TomPradat This sounds fair. However, I think that a simple flag would be enough (so the style apply applies to the children). |
I can work on this if you want |
@TomPradat Yes :) |
I'm not sure a flag is sufficient as we do not wrap the code with the What about a <CssBaseline restrictTo="#root" /> |
What's the issue with wrapping the root of the tree? Also, I think that in the current state of affairs, we should avoid to use style function in the core components. |
I'm not sure I understand you correctly, are you suggesting something like this ? // App.jsx
const App = () => (
<CssBaseline applyOnlyOnChildren>
<RestOfTheApp />
</CssBaseline>
); |
Yes, exactly. For the prop, we could name it |
Summary 💡
Add a prop "rootId" on the
CssBaseline
to apply the baseline css only on the div with the rootId idExamples 🌈
This would inject something like this:
Motivation 🔦
IMO this could be useful to help work in isolation. For example you want to integrate some mui components in a non-react website. This would allow to use the cssbaseline only on the part using the react components without the risk of breaking the website
The text was updated successfully, but these errors were encountered: