1.0.1 • Published 3 years ago
css2sprite v1.0.1
全局安装css2sprite
npm install -g css2sprite
css2sprite
css2sprite file
pic2sprite 生成 rem 单位的css文件
css2sprite file -u -s ./imgs
- u: rem 比例。默认100
- s: 图片源目录
合并样式中的 background:url("test.png?__sprite=1") 的图片并替换
.a {
background: url("./tpl_pt_18.png?__sprite=1");
}
.b {
background-image: url("./tpl_pt_18.png?__sprite=1");
}
转为
.d {
background: url('sprite-images.png') no-repeat -x -y;
background-size: width height;
}
1.0.1
3 years ago