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

1.0.2 • 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.1861,389latest
5.0.0-rc.2193next
4.0.0-nightly.2020.2.642nightly

Version History

VersionDownloads (Last 7 Days)Published
7.0.1861,389
7.0.0950,151
6.0.21,830,353
6.0.1127,804
6.0.0260,446
5.1.05,360,107
5.0.557,015
5.0.4111,272
5.0.336,827
5.0.2182,726
5.0.113,632
5.0.017,117
5.0.0-rc.2193
5.0.0-rc.12
5.0.0-rc.01
4.0.0-nightly.2020.2.642
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.92
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.253
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.311
4.0.0-nightly.2020.7.251
4.0.0-nightly.2020.7.242
4.0.12,793,898
4.0.04,410
4.0.0-rc.2286
4.0.0-rc.034
3.0.8760,460
3.0.713,473
3.0.62
3.0.53
3.0.4206
3.0.32
3.0.23
3.0.12
3.0.02
2.1.36,800
2.1.22
2.1.14
2.1.02
2.0.32
2.0.22
2.0.13
2.0.03
1.2.116
1.2.02
1.1.02
1.0.22
1.0.12
1.0.04

Package Sidebar

Install

npm i postcss-normalize-url@1.0.2

Version

1.0.2

License

MIT

Last publish

Collaborators

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