Material ui 列表项上的灰色背景色,而不是白色
我尝试使用材质ui制作列表,但由于某些原因,列表项的背景颜色变为灰色。我不明白这种灰色是从哪里来的。根据文档,列表项的颜色应为白色Material ui 列表项上的灰色背景色,而不是白色,material-ui,Material Ui,我尝试使用材质ui制作列表,但由于某些原因,列表项的背景颜色变为灰色。我不明白这种灰色是从哪里来的。根据文档,列表项的颜色应为白色 const muiTheme = getMuiTheme({ fontFamily: 'Roboto, sans-serif', palette: { primary1Color: blue500 } }); render () { return ( <MuiThemeProvider muiTheme={muiThe
const muiTheme = getMuiTheme({
fontFamily: 'Roboto, sans-serif',
palette: {
primary1Color: blue500
}
});
render () {
return (
<MuiThemeProvider muiTheme={muiTheme}>
<div>
<AppBar title='Test' showMenuIconButton={false} />
<List>
<Subheader>Heading</Subheader>
<ListItem primaryText="Nexus"/>
</List>
</div>
</MuiThemeProvider>
);
}
}
const muiTheme=getMuiTheme({
fontFamily:“机器人,无衬线”,
调色板:{
原色1:蓝色500
}
});
渲染(){
返回(
这就是造成灰色背景的原因-来自normalize.css
[type=submit], [type=reset], button, html [type=button] {
-webkit-appearance: button;
}
这就是造成灰色背景的原因——来自normalize.css
[type=submit], [type=reset], button, html [type=button] {
-webkit-appearance: button;
}
正如André所说,它在normalize.css(以及sanitize.css!)中。在不更改normalize的情况下解决此问题的一种方法是在父div上设置一个规则。我将ListItems放在抽屉中,在一个具有以下menuDrawer类的div中:
/*绕过背景为灰色的MaterialUI列表项*/
.menuDrawer[type=“button”]{
-webkit外观:继承;
}
正如André所说,它在normalize.css(以及sanitize.css!)中。在不更改normalize的情况下解决此问题的一种方法是在父div上设置规则。我的ListItems位于抽屉中,在一个具有以下menuDrawer类的div中:
/*绕过背景为灰色的MaterialUI列表项*/
.menuDrawer[type=“button”]{
-webkit外观:继承;
}