-
-
Notifications
You must be signed in to change notification settings - Fork 32.5k
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
[DatePicker] How to style the popper/dialog with styled (emotion)? #26767
Comments
@wouter-leistra what do you mean by
? Please provide a codesandbox that illustrates what is the problem. |
Sorry, added the sandbox that illustrates our situation. |
@mnajdova i updated the ticket... I'm still eager to learn how to do this on the datepicker... |
Ah, I see your confusion now. This should help you - https://next.material-ui.com/guides/interoperability/#portals Here is a dirty POC codesandbox - https://codesandbox.io/s/focused-fermi-sjcs1?file=/src/App.tsx When component uses portal inside, usually we recommend forwarding the |
There is a potential in improving the docs around this. Leaving the issue with docs label, so we can address this in the future. |
Is there a reason components that use portals can't just automatically forward the classname? I was debugging a tooltip (uses popper) and it took quite a while to figure out what was going wrong and then find the appropriate docs. |
The classes are forwarded to the children inside the portal component, so that it would be consistent with the other components (in terms the class name being applied on the root element in the react tree). |
This issue has been closed. If you have a similar problem but not exactly the same, please open a new issue. Note @wouter-leistra How did we do? Your experience with our support team matters to us. If you have a moment, please share your thoughts in this short Support Satisfaction survey. |
I've been going through the docs of emotion/styled as well as next.material-ui.com, but I can't find a way to style the dialogs/poppers and their contents. On the docs there is also no styles table for DatePicker API, which complicates things further.
I'm using the v5.0.0-alpha.36 packages for core and lab. Any advice is greatly appreciated.
In the sandbox link below you see that we have a customized theme that adds 4 colors to the palette. But the main question is how to style the popper/dialog with
styled
, datePicker components do not seem to support classes and therefore the example on how to style portals does not seem to work.Sandbox:
https://codesandbox.io/s/suspicious-montalcini-k3nhy
The text was updated successfully, but these errors were encountered: