Giter Club home page Giter Club logo

sus's Introduction

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
})

sus's People

Contributors

fat avatar koop avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.