im trying to apply !important
to the fill property of a SVG file but it seems that the syntax here is wrong, the !important
is not applied to the fill property and the circle
element is rendered with black color.
I’m wondering how to apply !important
to the fill property of SVG in react
<circle className="cls-1" cx="84.194" cy="83.49" r="83.48" style={{fill:'url('#linear-gradient') !important', strokeWidth:'0px'}} />
2
Answers
Please check your usage of backticks
'
in style attribute,Also please ensure,
#linear-gradient
is a valid element.In the style attribute, ensure that !important is appended directly after the value of the fill property, separated by a space. This modification ensures that the fill property is rendered with the desired gradient URL, prioritized by the !important declaration.