98f50939fd23c5249f08ed0b4994a4e9d00158b61bb50ab842e725857feb80e8c476df24bce51e0c8bb06be1ce48e2d192d52968063c38c0ac1dfcf5bc3f3b 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. # [postcss][postcss]-normalize-url
  2. > [Normalize URLs](https://github.com/sindresorhus/normalize-url) with PostCSS.
  3. ## Install
  4. With [npm](https://npmjs.org/package/postcss-normalize-url) do:
  5. ```
  6. npm install postcss-normalize-url --save
  7. ```
  8. ## Example
  9. ### Input
  10. ```css
  11. h1 {
  12. background: url("http://site.com:80/image.jpg")
  13. }
  14. ```
  15. ### Output
  16. ```css
  17. h1 {
  18. background: url(http://site.com/image.jpg)
  19. }
  20. ```
  21. Note that this module will also try to normalize relative URLs, and is capable
  22. of stripping unnecessary quotes. For more examples, see the [tests](test.js).
  23. ## Usage
  24. See the [PostCSS documentation](https://github.com/postcss/postcss#usage) for
  25. examples for your environment.
  26. ## API
  27. ### normalize([options])
  28. Please see the [normalize-url documentation][docs]. By default,
  29. `normalizeProtocol`, `stripFragment` & `stripWWW` are set to `false`.
  30. ## Contributors
  31. See [CONTRIBUTORS.md](https://github.com/cssnano/cssnano/blob/master/CONTRIBUTORS.md).
  32. ## License
  33. MIT © [Ben Briggs](http://beneb.info)
  34. [docs]: https://github.com/sindresorhus/normalize-url#options
  35. [postcss]: https://github.com/postcss/postcss