Pavliko / postcss-svg

PostCSS plug-in which to insert inline SVG to CSS and allows you to manage it colors.
http://pavliko.github.io/postcss-svg/
Creative Commons Zero v1.0 Universal
124 stars 23 forks source link

How to write correct path to svg? #36

Closed SVITY closed 7 years ago

SVITY commented 8 years ago

I have some independent react modules. For example http://take.ms/0VMBN How to get path to svg into images folder in css? I tried relative path like './images/hdc.svg', but it does not work.

senerdude commented 8 years ago

don't write file name just write path. ex : paths : ['./img/'] and in the CSS file call with file name and id like "test.svg#someid"

jonathantneal commented 7 years ago

You can write the paths with or without the starting ./. Modules do not require you specify the node_modules directory. See example