【问题标题】:set with and height on makeStyles theme material-ui在 makeStyles 主题材料-ui 上设置和高度
【发布时间】:2021-09-02 22:59:13
【问题描述】:
const useStyles = makeStyles(
  (theme) => ({
    iconContainer: {
      margin: theme.spacing(0, 4, 0, 0),
      [theme.breakpoints.up('md')]: {
        margin: theme.spacing(-1, 5, 0, -1),
      },
    },

   <Grid item className={classes.iconContainer}>
          {icon}
        </Grid>

路线:

如何通过主题来设置类iconContainer的高度和高度

【问题讨论】:

    标签: reactjs material-ui storybook makestyles


    【解决方案1】:

    您可以简单地将高度/宽度添加到 useStyles 对象。

    iconContainer: {
       width: 100, // px, you can use other units as well '40em', '40rem', '40%', etc... 
       height: 50, 
    }
    
    

    【讨论】:

    • 当图标像图标一样导入时,如何在故事书中有 100,50 的标志:ReactNode;
    猜你喜欢
    • 1970-01-01
    • 2019-02-28
    • 1970-01-01
    • 2020-12-24
    • 2018-08-05
    • 2014-07-14
    • 1970-01-01
    • 1970-01-01
    • 2019-08-12
    相关资源
    最近更新 更多