[英]How to change the size of an icon in Material UI 4.0?
我嘗試使用fontSize
以及height
和width
,但它不起作用。
例子:
/*Component code */
<Tooltip title="Disminuir cuotas">
<IconButton
className={clsx(classes.quotaIcons, classes.minusIcon, {
[classes.quotaIconsRight]: buttonsToTheRight
})}
size="small"
color="primary"
onClick={() => handleBillingsNumber('minus')}
>
<RemoveIcon />
</IconButton>
</Tooltip>
/*Component code */
const useStyles = makeStyles(theme => ({
quotaIcons: {
fontSize: 32,
color: theme.palette.primary.main
},
minusIcon: {
marginRight: theme.spacing(2)
},
quotaIconsRight: {
fontSize: 8
},
});
在@material-ui/icons
的圖標組件中使用fontSize="inherit"
,那么我們可以在上面看到的方式將起作用。
<RemoveIcon fontSize="inherit"/>
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.