简体   繁体   中英

How to override this materialui style

This is css style which material-ui is having for a checkbox which i captured from console
.MuiCheckbox-colorPrimary-262.MuiCheckbox-checked-260

When I tried to override this style is how i have tried overriding but it's not working

MuiCheckBox: {
    colorPrimary: {
      MuiCheckBox: {
        checked: {
          color:'#1565c0',
        }
      }
    }

Any help?

I assume that you want to override the checked color of Checkbox . Have a look at overriding styles in material-ui here .

Documentation already provided an example of changing checkbox color. Have a look at this example .

Create styles and apply the styles to Checkbox using classes property.

 const styles={ root:{ '&$checked':{ color: '#1565c0', } }, checked:{} } 

 <Checkbox classes={{ root:classes.root, checked:classes.checked}} {...props}/> 

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