[QUESTION] Is it possible to change "fill" property of a "Path" inside?
See original GitHub issueHi. I was wondering if it’d be possible to change “fill” property of a svg. I have the following svg:
<svg xmlns="http://www.w3.org/2000/svg" width="24.431" height="24.431" viewBox="0 0 24.431 24.431">
<g id="backspace" opacity="0.3">
<path id="path" d="M0,0H24.431V24.431H0Z" fill="none"/>
<path id="path-2" data-name="path" d="M22.4,3H7.126a1.916,1.916,0,0,0-1.619.9L0,12.162l5.507,8.256a1.925,1.925,0,0,0,1.619.906H22.4a2.042,2.042,0,0,0,2.036-2.036V5.036A2.042,2.042,0,0,0,22.4,3ZM19.341,15.816l-1.435,1.435L14.251,13.6,10.6,17.251,9.162,15.816l3.654-3.654L9.162,8.507,10.6,7.072l3.654,3.654,3.654-3.654,1.435,1.435-3.654,3.654Z" transform="translate(0 0.054)" fill="#CCC"/>
</g>
</svg>
I’ve imported this svg and changed its width and height:
import Backspace from '../../../Customization/assets/backspace.svg';
<Backspace width='39' height='39' />
Is it possible to change the “fill” property of the “path” with id=“path-2” without changing svg file?
Thank you.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:2
- Comments:29 (12 by maintainers)
Top Results From Across the Web
Can I change the fill color of an svg path with CSS?
Yes, you can apply CSS to SVG, but you need to match the element, just as when styling HTML. If you just want...
Read more >Fills and Strokes - SVG: Scalable Vector Graphics | MDN
Using fill sets the color inside the object and stroke sets the color of the line drawn around the object. You can use...
Read more >How to paint with fills and strokes in Illustrator - Adobe Support
Learn about assigning, applying, or removing fill and stroke attributes when painting in Adobe Illustrator.
Read more >Understanding the SVG fill-rule Property - SitePoint
When filling a shape or path, fill will paint open paths as if the last point of the path connected with the first,...
Read more >Control the Appearance of Marks in the View - Tableau Help
When the mark type is set to be a line (Automatic or Line), you can click the Path property in the Marks card...
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
Check that the SVG image that you are using has a fill color matching
#000
. You can also try restart your Metro packager with the--reset-cache
flag.I am also don’t see any effect of
.svgrrc
file. RN 0.60.5.Icon took from font-awesome library. I changed fill property from
currentColor
to#000
then created.svgrrc
with next content:Here is icon: