Security News
PyPI’s New Archival Feature Closes a Major Security Gap
PyPI now allows maintainers to archive projects, improving security and helping users make informed decisions about their dependencies.
postcss-auto-sprite
Advanced tools
PostCSS Auto Sprite plugin that generates css and sprites which grouped by directory from your stylesheets
PostCSS Auto Sprite plugin that generates css and sprites which grouped by directory from your stylesheets
$ npm install postcss-auto-sprite --save-dev
const gulp = require("gulp");
const postcss = require("gulp-postcss");
const sprite = require("postcss-auto-sprite");
gulp.task("css", () => {
return gulp
.src("*.css")
.pipe(
postcss([
sprite({
imgPath: __dirname + "/img/",
sliceDir: "slice",
spriteDir: "sprite",
spriteDisplay: "../img/sprite",
revision: "query", // 'filename' or 'query'
unit: "px", // 'px' or 'rem'
spritesmithOptions: {
padding: 10
},
revision: true
})
])
)
.pipe(gulp.dest("./dist/css"));
});
Before:
.icon1{
background-image: url('../img/slice/dir1/icon_1.png');
}
.icon2{
background-image: url('../img/slice/dir1/icon_2.png');
}
.icon3{
background-image: url('../img/slice/dir2/icon_3.png');
}
.icon4{
background-image: url('../img/slice/dir2/icon_4.png');
}
After:
.icon1{
width: 20px;
height: 20px;
background-image: url('../img/sprite/dir1.png');
background-position: 0px 0px;
background-size: 50px auto
}
.icon2{
width: 20px;
height: 20px;
background-image: url('../img/sprite/dir1.png');
background-position: -30px 0px;
background-size: 50px auto
}
.icon3{
width: 20px;
height: 20px;
background-image: url('../img/sprite/dir2.png');
background-position: 0px 0px;
background-size: 50px auto
}
.icon4{
width: 20px;
height: 20px;
background-image: url('../img/sprite/dir2.png');
background-position: -30px 0px;
background-size: 50px auto
}
FAQs
PostCSS Auto Sprite plugin that generates css and sprites which grouped by directory from your stylesheets
The npm package postcss-auto-sprite receives a total of 2 weekly downloads. As such, postcss-auto-sprite popularity was classified as not popular.
We found that postcss-auto-sprite demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
PyPI now allows maintainers to archive projects, improving security and helping users make informed decisions about their dependencies.
Research
Security News
Malicious npm package postcss-optimizer delivers BeaverTail malware, targeting developer systems; similarities to past campaigns suggest a North Korean connection.
Security News
CISA's KEV data is now on GitHub, offering easier access, API integration, commit history tracking, and automated updates for security teams and researchers.