Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

默认颜色改为currentColor #7

Open
FredKuo725 opened this issue Dec 7, 2020 · 4 comments
Open

默认颜色改为currentColor #7

FredKuo725 opened this issue Dec 7, 2020 · 4 comments
Labels
enhancement New feature or request

Comments

@FredKuo725
Copy link

组件的默认颜色属性值希望可以设置为“currentColor",或者在配置文件中提供默认颜色选项。
使用currentColor可以方便的利用当前字体的颜色作为图标颜色,这样就不用再单独给组件传颜色值

@fwh1990
Copy link
Member

fwh1990 commented Dec 7, 2020

更倾向于增加一个 defaultColor 的配置

@fwh1990 fwh1990 added the enhancement New feature or request label Dec 7, 2020
@imindzzz
Copy link

更倾向于增加一个 defaultColor 的配置

目前我们的需求是想方便的写hover改变颜色,参考antd是使用的currentColor的方案,想要一个配置来开启这个方案

我如果提交一个pr,可以考虑合并吗

@imindzzz
Copy link

临时解决方案 :getIconColor 函数改为返回 undefine,然后在hover样式里写 fill:red; color:red;

这样图标和文字都是红色了

P X) HZ7ME (F~MI7V6)HYD

@siecj
Copy link

siecj commented Aug 29, 2022

图片
源码中的上述逻辑,建议将"#333333"改为"currentColor"。这样的效果是如果svg里fill有值的时候,会使用这个颜色当做默认值,如果没有fill的时候,使用currentColor,这样可以随着字体颜色而自动改变。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants