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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179
  1. # selector-max-type
  2. Limit the number of type selectors in a selector.
  3. <!-- prettier-ignore -->
  4. ```css
  5. a {}
  6. /** ↑
  7. * This type of selector */
  8. ```
  9. This rule resolves nested selectors before counting the number of type selectors. Each selector in a [selector list](https://www.w3.org/TR/selectors4/#selector-list) is evaluated separately.
  10. The `:not()` pseudo-class is also evaluated separately. The rule processes the argument as if it were an independent selector, and the result does not count toward the total for the entire selector.
  11. ## Options
  12. `int`: Maximum type selectors allowed.
  13. For example, with `2`:
  14. The following patterns are considered violations:
  15. <!-- prettier-ignore -->
  16. ```css
  17. div a span {}
  18. ```
  19. <!-- prettier-ignore -->
  20. ```css
  21. div a {
  22. & span {}
  23. }
  24. ```
  25. <!-- prettier-ignore -->
  26. ```css
  27. div a {
  28. & > a {}
  29. }
  30. ```
  31. The following patterns are _not_ considered violations:
  32. <!-- prettier-ignore -->
  33. ```css
  34. div {}
  35. ```
  36. <!-- prettier-ignore -->
  37. ```css
  38. div a {}
  39. ```
  40. <!-- prettier-ignore -->
  41. ```css
  42. .foo div a {}
  43. ```
  44. <!-- prettier-ignore -->
  45. ```css
  46. div.foo a {}
  47. ```
  48. <!-- prettier-ignore -->
  49. ```css
  50. /* each selector in a selector list is evaluated separately */
  51. div,
  52. a span {}
  53. ```
  54. <!-- prettier-ignore -->
  55. ```css
  56. /* `span` is inside `:not()`, so it is evaluated separately */
  57. div a .foo:not(span) {}
  58. ```
  59. ## Optional secondary options
  60. ### `ignore: ["child", "compounded", "descendant", "next-sibling"]`
  61. #### `"child"`
  62. Discount child type selectors.
  63. For example, with `2`:
  64. The following patterns are _not_ considered violations:
  65. <!-- prettier-ignore -->
  66. ```css
  67. div span > a {}
  68. ```
  69. <!-- prettier-ignore -->
  70. ```css
  71. #bar div span > a {}
  72. ```
  73. #### `"compounded"`
  74. Discount compounded type selectors -- i.e. type selectors chained with other selectors.
  75. For example, with `2`:
  76. The following patterns are _not_ considered violations:
  77. <!-- prettier-ignore -->
  78. ```css
  79. div span a.foo {}
  80. ```
  81. <!-- prettier-ignore -->
  82. ```css
  83. div span a#bar {}
  84. ```
  85. #### `"descendant"`
  86. Discount descendant type selectors.
  87. For example, with `2`:
  88. The following patterns are _not_ considered violations:
  89. <!-- prettier-ignore -->
  90. ```css
  91. .foo div span a {}
  92. ```
  93. <!-- prettier-ignore -->
  94. ```css
  95. #bar div span a {}
  96. ```
  97. #### `"next-sibling"`
  98. Discount next-sibling type selectors.
  99. For example, with `2`:
  100. The following patterns are _not_ considered violations:
  101. <!-- prettier-ignore -->
  102. ```css
  103. div a + span {}
  104. ```
  105. <!-- prettier-ignore -->
  106. ```css
  107. #bar + div + span + a + span {}
  108. ```
  109. ### `ignoreTypes: ["/regex/", /regex/, "string"]`
  110. Given:
  111. ```
  112. ["/^my-/", "custom"]
  113. ```
  114. For example, with `2`.
  115. The following patterns are _not_ considered violations:
  116. <!-- prettier-ignore -->
  117. ```css
  118. div a custom {}
  119. ```
  120. <!-- prettier-ignore -->
  121. ```css
  122. div a my-type {}
  123. ```
  124. <!-- prettier-ignore -->
  125. ```css
  126. div a my-other-type {}
  127. ```