You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

55 lines
1.1 KiB

4 years ago
  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