target / react-native-svg-parser

Parses SVG files and converts to 'react-native-svg' format objects. NOTE: This project has been archived.
MIT License
42 stars 16 forks source link

Linear gradient support #17

Open aks1994 opened 5 years ago

aks1994 commented 5 years ago

Hi, thanks for making this library. One question I have is how do I use linear gradients in SVGs?

For example, in my svg object I have something like this:

<defs>
    <linearGradient id="mygradient">
      <stop offset="0" class="start-color"/>
      <stop offset="1" class="end-color"/>
    </linearGradient>
</defs>

and then in my css I would like to access it as follows: svg rect {fill: url(#mygradient);}

Currently the css styles are not able to access the mygradient property. Is there any workaround using this library for accessing definitions from ?

Thanks