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?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?