简体   繁体   English

如何增加material-ui图标?

[英]How to increase material-ui icons?

I am importing an icon from material-ui and using in my JSX code as我正在从material-ui导入一个图标并在我的 JSX 代码中使用

Full code:完整代码:

import ArrowUp from 'material-ui-icons/KeyboardArrowUp'
<Button fab color="primary">
  <ArrowUp style={{fontSize: '200%'}} />
</Button>

Using fontSize I cannot increase its size.使用 fontSize 我不能增加它的大小。

What is the proper way to handle it?处理它的正确方法是什么? What am I doing wrong?我做错了什么?

Try adding the label style of the button like below尝试添加按钮的标签样式,如下所示

import ArrowUp from 'material-ui-icons/KeyboardArrowUp'

<Button fab color="primary" labelStyle={{ fontSize: '200%' }}>
  <ArrowUp />
</Button>

Create class selector in icon component like this像这样在图标组件中创建类选择器

<Button fab color="primary">
  <ArrowUp className="arrow-up" />
</Button>

then write CSS code and give your style as important like this然后编写 CSS 代码并像这样赋予你的风格一样重要

.arrow-up{
 font-size: 20px !important;
}

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

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