global sprite configs for spacing closes #406

This commit is contained in:
Scott Davis 2012-03-24 09:10:25 -04:00
parent 81d2a44ef4
commit b40fa29e44
3 changed files with 38 additions and 16 deletions

View File

@ -13,7 +13,7 @@ $<%= name %>-layout:vertical !default;
$<%= name %>-inline : false !default; $<%= name %>-inline : false !default;
<% if skip_overrides %> <% if skip_overrides %>
$<%= name %>-sprites: sprite-map("<%= uri %>", $layout: $<%= name %>-layout, $cleanup: $<%= name %>-clean-up); $<%= name %>-sprites: sprite-map("<%= uri %>", $layout: $<%= name %>-layout, $cleanup: $<%= name %>-clean-up, $spacing: $<%= name %>-spacing, $position : $<%= name %>-position);
<% else %> <% else %>
// These variables control the generated sprite output // These variables control the generated sprite output
// You can override them selectively before you import this file. // You can override them selectively before you import this file.
@ -30,7 +30,9 @@ $<%= name %>-inline: false !default;
$<%= name %>-<%= sprite_name %>-repeat: $<%= name %>-<%= sprite_name %>-repeat, $<%= name %>-<%= sprite_name %>-repeat: $<%= name %>-<%= sprite_name %>-repeat,
<% end %> <% end %>
$layout : $<%= name %>-layout, $layout : $<%= name %>-layout,
$cleanup: $<%= name %>-clean-up $cleanup : $<%= name %>-clean-up,
$spacing : $<%= name %>-spacing,
$position : $<%= name %>-position
); );
<% end %> <% end %>

View File

@ -863,4 +863,24 @@ class SpritesTest < Test::Unit::TestCase
end end
it "should respect global spacing" do
css = render <<-SCSS
$colors-spacing:5px;
@import "colors/*.png";
@include all-colors-sprites;
SCSS
other_css = <<-CSS
.colors-sprite, .colors-blue, .colors-yellow {
background: url('/colors-s747dec274e.png') no-repeat;
}
.colors-blue {
background-position:0 0;
}
.colors-yellow {
background-position:0 -15px;
}
CSS
assert_correct clean(css), clean(other_css)
end
end end