svg-sprite/grunt-svg-sprite

change css background-position: from [%] to [px]

Opened this issue · 2 comments

Is there an option to change the output css background-position: to use Pixels instead of Percentages?
example:
(background: url("svg/sprite.css-4dbd03ed.svg") 0 62.465297057190455% no-repeat;)
change to (background: url("svg/sprite.css-4dbd03ed.svg") 0 20px no-repeat;)

jkphl commented

@contactjoelg Moving from absolute (pixel) to relative (percent) positioning was the improvement in the latest svg-sprite generation, as it enables you to use the sprites responsively. While I consider using absolute positioning a step backwards, you should still be able to do so by writing and using a custom output template. The absolute positioning variables are still available in the templates.

jkphl commented

As I said, there is no built-in option to switch back to absolute / pixel positioning. Go ahead and write your own customized template to do so. I provided a link to the docs in my previous comment.