Skip to content

tamaspap/css-replace-urls

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Rewrite urls in css

Resources

License

Stars

Watchers

Forks

Packages

No packages published