Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Image linking utilities for Stylus
JavaScript
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
lib added mime types for fonts
test
.gitignore
.jshintrc
.travis.yml
LICENSE
LICENSE.stylus Import url plugin from stylus
README.md
index.js
package.json
release-notes.md

README.md

stylus-images

Build Status

Image linking utilities for Stylus.

  • Merges duplicated data URIs
  • Loads resolution dependent images when available
  • Moves non-inlined relative url's into the output directory

Release Notes

Version 1.0

  • Rework the API to support multiple file output from a single stylus execution.

Old stylus plugin-based implementation is still an option using require('stylus-images').plugins

New implementations should use the stylus-image object in place of direct stylus calls:

  var stylusImages = require('stylus-images');

  var compiler = stylusImages('some stylus', {
    images: {
      limit: 123,
      resolutions: [1, 2]
    }
  });
  compiler.set('compress', true);
  compiler.render(function(err, data) {
    writeFile('css.css', data['1']);
    writeFile('css@1.5.css', data['1.5']);
    writeFile('css@2x.css', data['2']);
  });

Bitdeli Badge

Something went wrong with that request. Please try again.