Skip to content

Latest commit

 

History

History
36 lines (26 loc) · 564 Bytes

README.md

File metadata and controls

36 lines (26 loc) · 564 Bytes

css-url-rewrite

Build Status

Replace all @imports and url()s using a given function.

Installation

$ npm install --save css-url-rewrite

Usage

function replace(url) {
  return 'http://example.com' + url;
}

var replaced = rewriteCssUrls(css, replace);
body {
  background: url(/images/bg.png);
}

yields:

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