web 3d图形渲染器
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.

33 lines
1007 B

  1. # PostCSS Safe Parser
  2. <img align="right" width="135" height="95"
  3. title="Philosopher’s stone, logo of PostCSS"
  4. src="https://postcss.org/logo-leftp.svg">
  5. A fault-tolerant CSS parser for [PostCSS], which will find & fix syntax errors,
  6. capable of parsing any input. It is useful for:
  7. * Parse legacy code with many hacks. For example, it can parse all examples
  8. from [Browserhacks].
  9. * Works with demo tools with live input like [Autoprefixer demo].
  10. [Autoprefixer demo]: http://simevidas.jsbin.com/gufoko/quiet
  11. [Browserhacks]: http://browserhacks.com/
  12. [PostCSS]: https://github.com/postcss/postcss
  13. <a href="https://evilmartians.com/?utm_source=postcss">
  14. <img src="https://evilmartians.com/badges/sponsored-by-evil-martians.svg" alt="Sponsored by Evil Martians" width="236" height="54">
  15. </a>
  16. ## Usage
  17. ```js
  18. const safe = require('postcss-safe-parser')
  19. const badCss = 'a {'
  20. postcss(plugins).process(badCss, { parser: safe }).then(result => {
  21. result.css //= 'a {}'
  22. })
  23. ```