🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

spritesmith-css

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

spritesmith-css - npm Package Compare versions

Comparing version
1.0.0
to
1.0.1
+5
-1
package.json
{
"name":"spritesmith-css",
"version": "1.0.0",
"version": "1.0.1",
"description": "Generates the Sprites and the corresponding CSS",

@@ -12,2 +12,6 @@ "keywords": [

"author":"https://github.com/cuixiaorui",
"repository": {
"type": "git",
"url": "git://github.com/cuixiaorui/node-spritesmith-css"
},
"dependencies": {

@@ -14,0 +18,0 @@ "spritesmith": "^3.3.1"

# node-sprite-css
基于小图生成对应的精灵图和css样式。对于高清屏会生成对应的样式(这需要2x的小图集)
基于小图生成对应的 CSS Sprites ,并且支持高清屏的样式处理。
> 因为只是针对特定的问题点,所以没有提供额外的扩展性。

@@ -8,11 +9,41 @@ ## 安装

```
## API
## 使用
```js
const spritesmith2css = requir("spritesmith-css");
//src 为 1x 的 icon 地址列表
//src2 为 2x 的 icon 地址列表(用于支持 sprites,你必须使用两倍大小的 icon)
spritesmith2css({
src: src1x,
src2: src2x
});
```
1. src 需要一个数组,这个数组是包含你要合成的小图路径。
2. src2 2x的图片 可以没有此字段
3. output 输出的路径 默认值为:当前目录
4. name 输出的名称 默认值为:sprites
## Options
### src
- type: Array
- required: true
需要合并的图片的地址列表
### src2
- type: Array
- required: false
需要合并的两倍图的地址列表,用于支持高清屏(必须使用两倍大小的图片)
### output
- type: String
- default: './'
- required: false
输出的 CssSprites(合并后的大图和 css) 路径,默认为当前目录
### name
- type: String
- default: 'sprites'
- required: false
输出的名称
## License
MIT