JSPM

  • Created
  • Published
  • Downloads 11226890
  • Score
    100M100P100Q236566F
  • License MIT

Normalize URLs with PostCSS

Package Exports

  • postcss-normalize-url

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (postcss-normalize-url) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

postcss-normalize-url Build Status NPM version Dependency Status

Normalize URLs with PostCSS.

Install via npm:

npm install postcss-normalize-url --save

Example

var postcss = require('postcss')
var normalize = require('postcss-normalize-url');

var css = 'h1 { background: url("http://site.com:80/image.jpg") }';
console.log(postcss(normalize()).process(css).css);

// => 'h1 { background: url(http://site.com/image.jpg) }'

Note that this module will also try to normalize relative URLs, and is capable of stripping unnecessary quotes. For more examples, see the tests.

API

normalize([options])

Please see the normalize-url documentation. By default, normalizeProtocol and stripFragment are set to false.

Contributing

Pull requests are welcome. If you add functionality, then please add unit tests to cover it.

License

MIT © Ben Briggs