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.

59 lines
1004 B

4 years ago
  1. # [postcss][postcss]-normalize-string
  2. > Normalize strings with PostCSS.
  3. ## Install
  4. With [npm](https://npmjs.org/package/postcss-normalize-string) do:
  5. ```
  6. npm install postcss-normalize-string --save
  7. ```
  8. ## Example
  9. ### Input
  10. ```css
  11. p:after{ content: '\\'string\\' is intact' }
  12. ```
  13. ### Output
  14. ```css
  15. p:after{ content:"'string' is intact" }
  16. ```
  17. ## Usage
  18. See the [PostCSS documentation](https://github.com/postcss/postcss#usage) for
  19. examples for your environment.
  20. ## API
  21. ### normalize([options])
  22. #### options
  23. ##### preferredQuote
  24. Type: `string`
  25. Default: `double`
  26. Sets what type of quote to prefer. Possible values are `single` and `double`.
  27. ```js
  28. var css = 'p:after{content:""}';
  29. console.log(postcss(normalize({preferredQuote: 'single'})).process(css).css);
  30. //=> p:after{content:''}
  31. ```
  32. ## Contributors
  33. See [CONTRIBUTORS.md](https://github.com/cssnano/cssnano/blob/master/CONTRIBUTORS.md).
  34. ## License
  35. MIT © [Ben Briggs](http://beneb.info)
  36. [postcss]: https://github.com/postcss/postcss