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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. # selector-max-attribute
  2. Limit the number of attribute selectors in a selector.
  3. <!-- prettier-ignore -->
  4. ```css
  5. [rel="external"] {}
  6. /** ↑
  7. * This type of selector */
  8. ```
  9. This rule resolves nested selectors before counting the number of attribute 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 attribute selectors allowed.
  13. For example, with `2`:
  14. The following patterns are considered violations:
  15. <!-- prettier-ignore -->
  16. ```css
  17. [type="number"][name="quality"][data-attribute="value"] {}
  18. ```
  19. <!-- prettier-ignore -->
  20. ```css
  21. [type="number"][name="quality"][disabled] {}
  22. ```
  23. <!-- prettier-ignore -->
  24. ```css
  25. [type="number"][name="quality"] {
  26. & [data-attribute="value"] {}
  27. }
  28. ```
  29. <!-- prettier-ignore -->
  30. ```css
  31. [type="number"][name="quality"] {
  32. & [disabled] {}
  33. }
  34. ```
  35. <!-- prettier-ignore -->
  36. ```css
  37. [type="number"][name="quality"] {
  38. & > [data-attribute="value"] {}
  39. }
  40. ```
  41. <!-- prettier-ignore -->
  42. ```css
  43. /* `[type="text"][data-attribute="value"][disabled]` is inside `:not()`, so it is evaluated separately */
  44. input:not([type="text"][data-attribute="value"][disabled]) {}
  45. ```
  46. The following patterns are _not_ considered violations:
  47. <!-- prettier-ignore -->
  48. ```css
  49. [type="text"] {}
  50. ```
  51. <!-- prettier-ignore -->
  52. ```css
  53. [type="text"][name="message"] {}
  54. ```
  55. <!-- prettier-ignore -->
  56. ```css
  57. [type="text"][disabled]
  58. ```
  59. <!-- prettier-ignore -->
  60. ```css
  61. /* each selector in a selector list is evaluated separately */
  62. [type="text"][name="message"],
  63. [type="number"][name="quality"] {}
  64. ```
  65. <!-- prettier-ignore -->
  66. ```css
  67. /* `[disabled]` is inside `:not()`, so it is evaluated separately */
  68. [type="text"][name="message"]:not([disabled]) {}
  69. ```
  70. ## Optional secondary options
  71. ### `ignoreAttributes: ["/regex/", /regex/, "string"]`
  72. Given:
  73. ```
  74. ["/^my-/", "dir"]
  75. ```
  76. For example, with `0`.
  77. The following patterns are _not_ considered violations:
  78. <!-- prettier-ignore -->
  79. ```css
  80. [dir] [my-attr] {}
  81. ```
  82. <!-- prettier-ignore -->
  83. ```css
  84. [dir] [my-other-attr] {}
  85. ```