【发布时间】:2019-07-03 13:01:44
【问题描述】:
如何更改 Material UI 工具提示的背景颜色和颜色。我尝试如下,但它不起作用。
import { createMuiTheme } from '@material-ui/core/styles';
export const theme = createMuiTheme({
tooltip: {
color: '#ffffff',
rippleBackgroundColor: 'red'
}
});
import MuiThemeProvider from '@material-ui/core/styles/MuiThemeProvider';
import { theme } from "my-path";
<MuiThemeProvider theme={theme} >
<Tooltip
title={this.props.title}
placement={this.props.placement} className="customTooltipStyle">
<em className="fa fa-info-circle"></em>
</Tooltip>
</MuiThemeProvider>
【问题讨论】:
-
stackoverflow.com/questions/36759985/… 我想这有你需要的..
-
@S.Haviv - 我已经试过了。它不工作。这就是我问的原因。
-
另一个答案来自 Material-UI 的早期版本。我也在那个帖子上复制了我的答案,以便更容易找到。
标签: reactjs tooltip material-ui