简体   繁体   English

无法更改 React 图标的颜色(BiHomeAlt、BiSlider、FaTasks)

[英]Can't change color of React icons (BiHomeAlt, BiSlider , FaTasks)

In React you can change the color of an icon with icon context or the style attribute:在 React 中,您可以使用图标上下文或 style 属性更改图标的颜色:

<IconContext.Provider 
  value={{size: '40px' ,stroke: 'red',color:'red',fill:'red}} 
>
  <FaTasks>
</IconContext.Provider>

but it's not working what did i wrong i found some similar request on stackoverflow and some sort of bug request on github https://github.com/react-icons/react-icons/issues/404 or is it possibel that some react icons can't be styled with colors但它不起作用我做错了什么我在stackoverflow上发现了一些类似的请求,在github https://github.com/react-icons/react-icons/issues/404上发现了某种错误请求,或者是否可能有一些反应图标不能用颜色设计

and what's the difference between stroke ,fill ,color?描边、填充、颜色之间有什么区别?

just add color prop or fill prop, i cant remember which one.只需添加颜色道具或填充道具,我不记得是哪一个。 lol哈哈

<FaTasks color="red" fill="red">

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

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