简体   繁体   中英

What is the best way to override CSS in MUI without using MUI themes?

I am using Material UI in my project. I want to know the best way to override the CSS in react components without using MUI theme.

You can simply give your own class name to the MUI component and apply your own style.

However, sometimes you will need to use MUI original class names in order to override inner properties that you can't access by yourself but as long you have your own parent class (in order to not override other MUI components with same inner class names) it should work just fine.

You have many ways to customize Material UI components:

  1. One-off customization
  2. Reusable component
  3. Global theme overrides
  4. Global CSS override

All of these methods are explained in detail in Mui Documentation > Customization

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM