Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Divider color change React Material Ui

I'm working with the divider component of the material ui framework and am stuck with the color changing aspect. With most other components from this framework I've been able to change the color by applying the useStyles() method as such:

const useStyles = makeStyles(theme => ({
    textPadding: {
      paddingTop: 10,
      paddingBottom: 10,
      color:'white',
    },
}));

But I'm not able to change the color of the dividers using the same approach:

const useStyles = makeStyles(theme => ({
dividerColor: {
  backgroundColor: 'white',
},
}));

I of-course then apply it to the component:

<Divider classname={classes.dividerColor}></Divider>

I looked up the docs for it but can't figure out what I've done wrong. Could someone give me a helping hand?

like image 226
Sirre Avatar asked Oct 09 '19 01:10

Sirre


1 Answers

You can use
<Divider style={{ background: 'black' }} variant="middle" />

like image 63
Gnyasha Avatar answered Sep 17 '22 17:09

Gnyasha