问题
Not able to assign custom class to tooltip component in order to update the style of tooltip component
Tried by assigning to classes property
Posted at https://codesandbox.io/s/twilight-fire-907mp
回答1:
Make your own Tooltip with custom styles and then use it:
const TooltipWithBiggerFontSize = withStyles({
tooltip: {
fontSize: 30
}
})(Tooltip)
As you already did with other components, eg: DialogContent
or DialogActions
.
Usage
<TooltipWithBiggerFontSize title="Custom Search">
<Publish />
</TooltipWithBiggerFontSize>
BTW, your code is confusing. You are mixing functional and class components. Once, you are styling with withStyles
once with makeStyles
.
You should choose one method and stick to it. Here is styling docs. It will solve most of your problems.
codesandbox
来源:https://stackoverflow.com/questions/56885144/how-to-modify-font-size-style-of-tooltip-component