currentcolor fill support
See original GitHub issueIn the web browser, setting the fill
of an SVG element (path, etc.) instructs the element to inherit its color
from the parent of the SVG. Attempting this with a react-native-svg
Svg.Path
element currently results in the following warning: "currentcolor" is not a valid color or brush
.
Could we add support for currentcolor
fills? I have provided the example code and the stack trace below.
<Svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16">
<Svg.G fill="none" fill-rule="evenodd">
<Svg.Path d="M-4-4h24v24H-4z" />
<Svg.Path
fill="currentcolor"
fill-rule="nonzero"
d="M16 7H3.83l5.59-5.59L8 0 0 8l8 8 1.41-1.41L3.83 9H16z"
/>
</Svg.G>
</Svg>
Issue Analytics
- State:
- Created 6 years ago
- Comments:14
Top Results From Across the Web
CSS currentColor value | Can I use... Support ... - CanIUse
A CSS value that will apply the existing color value to other properties like background-color , etc. Usage % of. all users, all...
Read more >currentcolor | CSS-Tricks
Use cases. Using it in animation; Button borders and SVG fills that match the text · Interface design that inherits color all around...
Read more >Understanding the currentColor Keyword in CSS - DigitalOcean
A super short post that tells you what the currentColor keyword is used for in CSS and how to make good use of...
Read more >currentcolor fill support · Issue #589 · software-mansion/react ...
In the web browser, setting the fill of an SVG element (path, etc.) instructs the element to inherit its color from the parent...
Read more ><color> - CSS: Cascading Style Sheets - MDN Web Docs
The currentcolor keyword represents the value of an element's color property. This lets you use the color value on properties that do not ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
For those searching for a way to use
react-native-svg
(version 6.x and below) with SVG containingcurrentColor
orinherit
value infill
attribute.Let’s take a look at this PR which replaces
currentColor
(orinherit
) values by reference toprops.color
and so emulate thecurrentColor
behaviour.https://github.com/CoorpAcademy/components/pull/1436/files#diff-90ea253cb3ce7782845a01a0787e17c0R82
Enjoy 🙌
I am running into this issue on newest expo and react-native. Is there a solution for
without throwing a console warning?