twolfson / spritesmith

Utility that takes sprites and converts them into a stylesheet and its coordinates
MIT License
914 stars 56 forks source link

Disallow units for zero values #61

Closed pure-js closed 8 years ago

pure-js commented 8 years ago

Please add if statement for background position value, and if value is zero write it without px. At this moment generated code looks like this:

$icon_assistant_x = 0px;

But will be excellent, if it would look like this

$icon_assistant_x = 0;
twolfson commented 8 years ago

This is a duplicate of https://github.com/Ensighten/grunt-spritesmith/issues/156, https://github.com/Ensighten/grunt-spritesmith/issues/89, https://github.com/twolfson/spritesheet-templates/pull/43, and https://github.com/twolfson/spritesheet-templates/issues/11.

This request is entering CSS optimization territory and encourage developers to use another CSS optimization task after spritesmith to handle adjusting rules (e.g. 0px -> 0). Here are some tools to evaluate: