Closed evilbloodydemon closed 10 years ago
There's a workaround for this issue, not too stylish, though working for me (I use SCSS): in css-sprite\lib\templates\sprite.js:
Original text:
// Render and return CSS var css = mustache.render(tmpl[options.processor], tmplParams);
replace with: var css = mustache.render(tmpl[options.processor], tmplParams).replace(/\/g, '/');
It changes all '\' into '/' in output. It's OK for scss syntax, though I do not know if '\' char is used in other syntaxes. Anyway best wishes to everyone and billions of thanks to authors.
This issue is still valid with 0.9.0-beta2
I fixed this :confused: #29
I am generating plain css via gulp (however issue occurs even from command line) with the following options: name: 'somename', cssPath: '../img', prefix: 'icon-test' The resulting css always contains the following at the beginning (for Windows): .icon-test { background-image: url('..\img\somename.png'); }
Adams fix is not released yet. Till the release you could use the git master instead of 0.9.0-beta2. In your package.json use:
"dependencies": { "css-sprite": "aslansky/css-sprite" }
That makes sense now. Thanks.
css-sprite uses path.join to make css path, and on windows path.join uses backslash so result is invalid, something like: background-image: url('\img\sprite.png');