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.

55 lines
1.1 KiB

  1. # postcss-selector-matches [![CSS Standard Status](https://cssdb.org/badge/matches-pseudo-class.svg)](https://cssdb.org/#matches-pseudo-class) [![Build Status](https://travis-ci.org/postcss/postcss-selector-matches.svg?branch=master)](https://travis-ci.org/postcss/postcss-selector-matches)
  2. > PostCSS plugin to transform `:matches()` W3C CSS pseudo class to more compatible CSS selectors
  3. http://dev.w3.org/csswg/selectors-4/#matches
  4. ## Installation
  5. ```console
  6. $ npm install postcss-selector-matches
  7. ```
  8. ## Usage
  9. ```js
  10. var postcss = require("postcss")
  11. var output = postcss()
  12. .use(require("postcss-selector-matches"))
  13. .process(require("fs").readFileSync("input.css", "utf8"))
  14. .css
  15. ```
  16. Using this `input.css`:
  17. ```css
  18. p:matches(:first-child, .special) {
  19. color: red;
  20. }
  21. ```
  22. you will get:
  23. ```css
  24. p:first-child, p.special {
  25. color: red;
  26. }
  27. ```
  28. **Note that if you are doing crazy selector like `p:matches(a) {}` you are likely to get crazy results (like `pa {}`)**.
  29. ## Options
  30. ### `lineBreak`
  31. (default: `false`)
  32. Allows you to introduce a line break between generated selectors.
  33. ---
  34. ## [Changelog](CHANGELOG.md)
  35. ## [License](LICENSE)