lucasmazza / spriteful

You know, sprites
Other
154 stars 13 forks source link

Make possible to choose the extension strategy #9

Closed rafaelfranca closed 11 years ago

rafaelfranca commented 11 years ago

Add a option to choose the extension strategy when using SCSS format.

The placeholder selector strategy doesn't work very well in non-modern browsers (aka IE8) since it may create huge CSS selectors chain and the browser will not parse they.

So, for this case is better to use the mixin strategy.

USAGE

spriteful images/icons -f scss --mixin

Will generate a file like:

@mixin icons-sprite {
  background-image: image-url('sprites/icons.png');
  background-repeat: no-repeat;
}

%icons-sprite-new {
  @include my-sprite;
  background-position: 0px 0px;
}

The final user usage continue the same:

// in your SCSS code...
.button {
  @extend %icons-sprite-new;
}