sprity-sass
v1.0.4
Published
scss/sass style processor for sprity
Downloads
289
Maintainers
Readme
sprity-sass
A sass/scss style processor for sprity
Requirements
- sprity version >= 1.0
Install
Install with npm
npm install sprity sprity-sass --save
If you want to use sprity-sass
with the command line interface of sprity
install it globally.
npm install sprity sprity-sass -g
Options
- style-type: Eighter scss or sass. Defaults to scss.
Usage
On commandline:
sprity out/ src/*.png -s style.scss -p sass --style-type scss
In JavaScript:
var sprite = require('sprity');
sprite.create({
...
style: 'style.scss',
processor: 'sass'
'style-type': 'scss'
...
}, function () {
console.log('done');
});
scss usage example
@import 'sprite'; // the generated style file (sprite.scss)
// camera icon (camera.png in src directory)
.icon-camera {
@include sprite($camera);
}
// cart icon (cart.png in src directory)
.icon-cart {
@include sprite($cart);
}
sass usage example
@import 'sprite' // the generated style file (sprite.sass)
// camera icon (camera.png in src directory)
.icon-camera
+sprite($camera)
// cart icon (cart.png in src directory)
.icon-cart
+sprite($cart)
More
See sprity documentation