cssdream / cssgrace

从今天起,写简单优雅面向未来的 CSS。From now on,writing brief,elegant,future-oriented CSS.
MIT License
592 stars 63 forks source link

SVG background-image support #40

Open ericorruption opened 8 years ago

ericorruption commented 8 years ago

I'm using an svg as a background-image, but cssgrace throws the following error:

'TypeError: invalid svg at Object.calculate (/Users/username/code/project-name/node_modules/image-size/lib/types/svg.js:61:13)
                        at lookup (/Users/username/code/project-name/node_modules/image-size/lib/index.js:27:31)
                        at module.exports (/Users/username/code/project-name/node_modules/image-size/lib/index.js:101:12)
                        at imageSetMixin (/Users/username/code/project-name/node_modules/cssgrace/lib/index.js:422:9)
                        at /Users/username/code/project-name/node_modules/cssgrace/lib/index.js:476:5
                        at /Users/username/code/project-name/node_modules/postcss/lib/container.js:86:34
                        at /Users/username/code/project-name/node_modules/postcss/lib/container.js:71:26
                        at Rule.each (/Users/username/code/project-name/node_modules/postcss/lib/container.js:58:22)
                        at Rule.walk (/Users/username/code/project-name/node_modules/postcss/lib/container.js:70:21)
                        at Rule.walkDecls (/Users/username/code/project-name/node_modules/postcss/lib/container.js:84:25)'

Is this because the plugin doesn't support .SVG files? I'm using an image generated by Illustrator. If the plugin doesn't support SVG it should skip svg files, I think.

machwatt commented 8 years ago

+1 problem occurs with icons from adobe illustrator