mui / material-ui

Material UI: Comprehensive React component library that implements Google's Material Design. Free forever.
https://mui.com/material-ui/
MIT License
93.69k stars 32.22k forks source link

zIndex theme override - module augmentation #34923

Closed SpareShade closed 1 year ago

SpareShade commented 1 year ago

Hi, thank you for this great library!!

I'm trying to extend (theme) the zIndex values eg. authMod: 2000, and I cannot find any way to do that.

The question is related to issue opened in 2019 #17796 but the conversation there skewed into direction of addressing the cusomisation of popper and the original question was not addressed.

Is there any way to extend/add new values to the zIndex theme object?

Thank you :)

mnajdova commented 1 year ago

Here is a codesandbox illustrating how you can do this: https://codesandbox.io/s/infallible-nova-n360po?file=/src/App.tsx. If you have a doubt/question next time, I would suggest looking into the exported types from @mui/material/styles and just override the type that you need. I hope this helps.

github-actions[bot] commented 1 year ago

👋 Thanks for using MUI Core!

We use GitHub issues exclusively as a bug and feature requests tracker, however, this issue appears to be a support request.

For support, please check out https://mui.com/getting-started/support/. Thanks!

If you have a question on Stack Overflow, you are welcome to link to it here, it might help others. If your issue is subsequently confirmed as a bug, and the report follows the issue template, it can be reopened.

SpareShade commented 1 year ago

@mnajdova thank you Marija!! That hint clarified a lot for me :)