postcss-normalize-url
TypeScript icon, indicating that this package has built-in type declarations

1.2.1 • Public • Published

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

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
7.0.1609,855latest
5.0.0-rc.2223next
4.0.0-nightly.2020.2.653nightly

Version History

VersionDownloads (Last 7 Days)Published
7.0.1609,855
7.0.01,052,193
6.0.21,732,610
6.0.1135,837
6.0.0273,413
5.1.04,933,299
5.0.532,076
5.0.487,508
5.0.333,547
5.0.2132,205
5.0.111,180
5.0.012,868
5.0.0-rc.2223
5.0.0-rc.11
5.0.0-rc.02
4.0.0-nightly.2020.2.653
4.0.0-nightly.2020.1.111
4.0.0-nightly.2020.1.91
4.0.0-nightly.2020.10.201
4.0.0-nightly.2020.9.91
4.0.0-nightly.2020.9.31
4.0.0-nightly.2020.9.11
4.0.0-nightly.2020.8.291
4.0.0-nightly.2020.8.250
4.0.0-nightly.2020.8.241
4.0.0-nightly.2020.8.171
4.0.0-nightly.2020.8.101
4.0.0-nightly.2020.8.41
4.0.0-nightly.2020.8.11
4.0.0-nightly.2020.7.312
4.0.0-nightly.2020.7.252
4.0.0-nightly.2020.7.242
4.0.12,161,008
4.0.02,106
4.0.0-rc.235
4.0.0-rc.00
3.0.8366,009
3.0.71,097
3.0.62
3.0.51
3.0.41
3.0.31
3.0.21
3.0.11
3.0.01
2.1.34,955
2.1.22
2.1.11
2.1.02
2.0.31
2.0.21
2.0.12
2.0.01
1.2.110
1.2.01
1.1.01
1.0.21
1.0.11
1.0.01

Package Sidebar

Install

npm i postcss-normalize-url@1.2.1

Version

1.2.1

License

MIT

Last publish

Collaborators

  • beneb
  • trysound
  • ludovicofischer
  • ai
  • chriseppstein
  • andyjansson
  • evilebottnawi
  • cssnano-bot