Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

astros-css-sprite

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

astros-css-sprite

自动合并雪碧图

latest
Source
npmnpm
Version
1.0.4
Version published
Maintainers
1
Created
Source

自动合并雪碧图

该中间件简化了雪碧图合并。使用图片时,按目录存放在 root/img/sprite 下,在CSS中正常引用单张图片,发布时,该中间件会自动按目录合并雪碧图,并替换CSS中的图片引用。

###开发中

图片路径

root/img/sprite/button/loading.png
root/img/sprite/button/cancel.png

CSS中引用

.btn-loading{ background-image:url(/img/sprite/button/loading.png); } .btn-cancel{ background-image:url(/img/sprite/button/calcel.png); }

###发布后

图片路径

root/img/sprite_button.png

CSS中引用

.btn-loading{
    background:url(~/img/sprite_button.png) no-repeat 0 0;
    background-size: 100% 100%;
}

.btn-loading{
    background:url(~/img/sprite_button.png) no-repeat 100px 100px;
    background-size: 100% 100%;
}

FAQs

Package last updated on 08 Sep 2016

Did you know?

Socket

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.

Install

Related posts