reworkcss / rework-plugin-url

url() plugin for rework, formerly included in core

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

rework-plugin-url

Build Status

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

Installation

$ npm install --save rework-plugin-url

Usage

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

About

url() plugin for rework, formerly included in core

License:MIT License


Languages

Language:JavaScript 100.0%