简体   繁体   English

React Material UI 图标响应性

[英]React Material UI Icon Responsiveness

How can i make the material icon to responsive font-size ?我怎样才能使材料图标响应字体大小? My current code is我目前的代码是

<div>
  <div
    style={{
      margin: "5px",
      display: "flex",
      alignItems: "center",
      flexWrap: "wrap",
    }}
  >
    <ArrowBackIosIcon fontSize="14px" />
    <p>Text</p>
  </div>
  <div>
    <p>Text</p>
  </div>
  <div>
    <p>Text</p>
  </div>
</div>

i want to change the font size of the icon on mobile and tablet.我想更改手机和平板电脑上图标的字体大小。

FYI: i am using react and material ui library.仅供参考:我正在使用反应和材料 ui 库。

你可以这样做:

<ArrowBackIosIcon sx={{fontSize: { xs: 12, sm: 16, md: 25, lg: 30 } }} />

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM