You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We had to revert this fix in version 5.12.1 because it turned out that many users relied on the previous behavior where the fill attribute is cleared, rather than manually handling this for icons exported from Figma. This use case seems to be more common than using icons with a built-in fill. Therefore, we will consider this behavior as the standard for our components for now.
In the future, we might explore alternative solutions that would not introduce such a significant breaking change. For example, we could consider enabling this fix based on a specific setting. However, currently, we do not see a strong demand for cases where an icon must retain its custom color. That said, this can still be achieved using the following workarounds:
Wrap the icon to prevent the fill from being applied by our SVG component:
…from 5.12.0 version. Because it turned out that many users relied on the previous behavior where the fill attribute was cleared by default. If you need to render icon with built-in fill, please look at this issue comment - #2684 (comment)
Description
The top-level attribute
"fill"
is erased when SVG is rendered usingSvg.tsx/IconContainer.tsx
components.Example of SVG which has this issue:
Root cause
Svg.tsx
passesfill={undefined}
to native<svg>
element if the "fillColor" property is not provided. As a result "fill" attribute is erased from*.svg
Actual result
Property "fill" is removed from top level
<svg>
element. As of now, we have to apply next workaround:Expected result
Property "fill" is not removed from top level
<svg>
element.Environment
The text was updated successfully, but these errors were encountered: