ant-design / ant-design-icons

⭐ Ant Design SVG Icons
https://ant.design/components/icon/
MIT License
960 stars 582 forks source link

IconService changes fill property of svg #536

Closed drilko closed 2 weeks ago

drilko commented 2 years ago

Hello, I have this svg: <svg width="15" height="15" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M8.288 2.25L3.156 7.681a1.906 1.906 0 00-.418.894L2.506 10.6c-.08.731.444 1.231 1.17 1.106l2.012-.343c.28-.05.675-.257.868-.47l5.132-5.43c.887-.938 1.287-2.007-.094-3.313-1.375-1.294-2.419-.837-3.306.1zM7.431 3.156a3.829 3.829 0 003.406 3.219M1.875 13.75h11.25" stroke="currentColor" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"/></svg>

When I load it by using namespace load, its fill property get replaced with currentColor which messes up the svg (it get fully black).

Is there any reason why IconService is doing this on custom svgs?

ilxqx commented 2 weeks ago

同样的问题,为什么自定义图标要添加一个 fill 为 currentColor 属性呢? 我的图标渲染会有问题:

image

错误的渲染:

image