Sass and Compass in Action by Wynn Netherland Nathan Weizenbaum Chris Eppstein Brandon Mathis

Sass and Compass in Action by Wynn Netherland Nathan Weizenbaum Chris Eppstein Brandon Mathis

Author:Wynn Netherland, Nathan Weizenbaum, Chris Eppstein, Brandon Mathis
Language: eng
Format: mobi
Publisher: Manning
Published: 0101-01-01T00:00:00+00:00

.add-button {

@include icons-sprite(box-add);

}

This will only output the CSS necessary to style this element.

Listing 6.8. Generated single-sprite CSS

.icons-sprite,

.add-button {

background: url('/images/icons-s0cad3f8f97.png') no-repeat;

}

.add-button { background-position: 0 -358px; }

With the single-sprite mixin, it’s not necessary to generate a class name for the sprite styles because it’s included inside of a selector. Compass uses that selector, in this case .add-button, when it adds styles for background-image and background-position. Whereas the all-sprites mixin is nice and easy, this approach generates less CSS and gives you more control of your output.

It’s a nice start, but sometimes you need even more control of the spriting process. Next, you’ll see how Compass gives you the control you need without making you do all the work.



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
Web Analytics