Mods/node_modules/rework-plugin-url
Repository files (latest commit first)
Filename Latest commit message Latest commit date
oitsjustjose 6b60015c02 --
2017-02-26 17:06:42 -05:00
..
.npmignore -- 2017-02-26 17:06:42 -05:00
.travis.yml -- 2017-02-26 17:06:42 -05:00
index.js -- 2017-02-26 17:06:42 -05:00
LICENSE -- 2017-02-26 17:06:42 -05:00
package.json -- 2017-02-26 17:06:42 -05:00
README.md -- 2017-02-26 17:06:42 -05:00

rework-plugin-url

Build Status

Map url() calls. Replace all url()s using a given function.

var css = rework(read(css))
  .use(rework.url(function(url){
    return 'http://example.com' + url;
  }))
  .toString()
body {
  background: url(/images/bg.png);
}

yields:

body {
  background: url(http://example.com/images/bg.png);
}