Software zum Installieren eines Smart-Mirror Frameworks , zum Nutzen von hochschulrelevanten Informationen, auf einem Raspberry-Pi.
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.

README.md 1.3KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. # postcss-resolve-nested-selector
  2. [![Build Status](https://travis-ci.org/davidtheclark/postcss-resolve-nested-selector.svg?branch=master)](https://travis-ci.org/davidtheclark/postcss-resolve-nested-selector)
  3. Given a (nested) selector in a PostCSS AST, return an array of resolved selectors.
  4. Tested to work with the syntax of
  5. [postcss-nested](https://github.com/postcss/postcss-nested)
  6. and [postcss-nesting](https://github.com/jonathantneal/postcss-nesting).
  7. Should also work with SCSS and Less syntax. If you'd like to help out by
  8. adding some automated tests for those, that'd be swell. In fact, if you'd
  9. like to add any automated tests, you are a winner!
  10. ## API
  11. `resolveNestedSelector(selector, node)`
  12. Returns an array of selectors resolved from `selector`.
  13. For example, given this JS:
  14. ```js
  15. var resolvedNestedSelector = require('postcss-resolve-nested-selector');
  16. postcssRoot.eachRule(function(rule) {
  17. rule.selectors.forEach(function(selector) {
  18. console.log(resolvedNestedSelector(selector, rule));
  19. });
  20. });
  21. ```
  22. And the following CSS:
  23. ```scss
  24. .foo {
  25. .bar {
  26. color: pink;
  27. }
  28. }
  29. ```
  30. This should log:
  31. ```
  32. ['.foo']
  33. ['.foo .bar']
  34. ```
  35. Or with this CSS:
  36. ```scss
  37. .foo {
  38. .bar &,
  39. a {
  40. color: pink;
  41. }
  42. }
  43. ```
  44. This should log:
  45. ```
  46. ['.foo']
  47. ['.bar .foo']
  48. ['.foo a']
  49. ```