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.7KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. # selector-max-compound-selectors
  2. Limit the number of compound selectors in a selector.
  3. <!-- prettier-ignore -->
  4. ```css
  5. div .bar[data-val] > a.baz + .boom > #lorem {}
  6. /* ↑ ↑ ↑ ↑ ↑
  7. ↑ ↑ ↑ ↑ ↑
  8. Lv1 Lv2 Lv3 Lv4 Lv5 -- these are compound selectors */
  9. ```
  10. A [compound selector](https://www.w3.org/TR/selectors4/#compound) is a chain of one or more simple (tag, class, ID, universal, attribute) selectors. If there is more than one compound selector in a complete selector, they will be separated by combinators (e.g. ``, `+`, `>`). One reason why you might want to limit the number of compound selectors is described in the [SMACSS book](http://smacss.com/book/applicability).
  11. This rule resolves nested selectors before counting the depth of a selector. Each selector in a [selector list](https://www.w3.org/TR/selectors4/#selector-list) is evaluated separately.
  12. `:not()` is considered one compound selector irrespective to the complexity of the selector inside it. The rule _does_ process that inner selector, but does so separately, independent of the main selector.
  13. ## Options
  14. `int`: Maximum compound selectors allowed.
  15. For example, with `3`:
  16. The following patterns are considered violations:
  17. <!-- prettier-ignore -->
  18. ```css
  19. .foo .bar .baz .lorem {}
  20. ```
  21. <!-- prettier-ignore -->
  22. ```css
  23. .foo .baz {
  24. & > .bar .lorem {}
  25. }
  26. ```
  27. The following patterns are _not_ considered violations:
  28. <!-- prettier-ignore -->
  29. ```css
  30. div {}
  31. ```
  32. <!-- prettier-ignore -->
  33. ```css
  34. .foo div {}
  35. ```
  36. <!-- prettier-ignore -->
  37. ```css
  38. #foo #bar > #baz {}
  39. ```
  40. <!-- prettier-ignore -->
  41. ```css
  42. .foo + div :not (a b ~ c) {} /* `a b ~ c` is inside `:not()`, so it is evaluated separately */
  43. ```