gpt4 book ai didi

material-ui - 你如何设置一个material-ui ListItem的波纹颜色?

转载 作者:行者123 更新时间:2023-12-04 21:34:31 24 4
gpt4 key购买 nike

我似乎可以在文档中的任何地方找到如何在 material-ui ListItem 上设置波纹颜色。我将 ListItem 包裹在 MuiThemeProvider 中,我的覆盖主题如下所示:

const muiTheme = getMuiTheme({
palette: {
hoverColor: 'red',
},
});

<MuiThemeProvider muiTheme={muiTheme}>
<ListItem>
...
</ListItem>
</MuiThemeProvider>

我应该设置什么调色板颜色属性来更改波纹颜色?

最佳答案

我来这里研究 Button 上的一个类似问题,但它似乎在涟漪效应中是一致的,所以也许这会对将来的某人有所帮助。

在 Material-UI next/v1 中,rippleColor 显式链接到元素的标签颜色。如果您希望波纹和标签的颜色不同,则必须分别覆盖标签颜色。

import MUIButton from 'material-ui/Button';
import {withStyles} from 'material-ui/styles';

const Button = (props) => {

return <MUIButton className={props.classes.button}>Hat</MUIButton>

const styles = {
button: {color: 'rebeccapurple'}
};

export default withStyles(styles)(Button);

这应该会给你一个覆盖的波纹颜色。

关于material-ui - 你如何设置一个material-ui ListItem的波纹颜色?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42008913/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com