sus

simple data-uri stylesheet generator

  • 所有者: Medium/sus
  • 平台:
  • 许可证: Other
  • 分类:
  • 主题:
  • 喜欢:
    0
      比较:

Github星跟踪图

SUS

SUS parses your css source and generates two new CSS sources from it – a base source and a sprites source.

The base source has all your original styles minus all background image defintions.

The sprites source has all your background image defintions, but converted to data-uris

CLI

install sus with npm install sus -g

you can then run sus from your terminal

$ sus path/to/css/app.css

This will generate two files in place:

css
├── app-base.css
└── pay-sprites.css

Alternatively you can pass an option --out to specify which location the generated styles are placed:

$ sus path/to/css/app.css --out out/css/

Programatic API

Sus accepts a string of css source and an options object. Use the options object to specify the location that your css is referencing images from. Alternatively pass a tranformer method to the base object to return fully resolved image paths.

var sus = require('sus')

sus(data, {
  base: '/foo/bar'
}).parse(function (err, parsed) {
  parsed.base()    // base css styles
  parsed.sprites() // base css styles
})

主要指标

概览
名称与所有者Medium/sus
主编程语言JavaScript
编程语言JavaScript (语言数: 2)
平台
许可证Other
所有者活动
创建于2012-10-24 23:08:09
推送于2023-04-06 23:53:19
最后一次提交2014-04-21 21:08:24
发布数0
用户参与
星数692
关注者数176
派生数23
提交数24
已启用问题?
问题数0
打开的问题数0
拉请求数4
打开的拉请求数0
关闭的拉请求数0
项目设置
已启用Wiki?
已存档?
是复刻?
已锁定?
是镜像?
是私有?