簡體   English   中英

如何在 Material UI 4.0 中更改圖標的大小?

[英]How to change the size of an icon in Material UI 4.0?

我嘗試使用fontSize以及heightwidth ,但它不起作用。

例子:

/*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.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM