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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  1. # selector-max-specificity
  2. Limit the specificity of selectors.
  3. <!-- prettier-ignore -->
  4. ```css
  5. .foo, #bar.baz span, #hoo { color: pink; }
  6. /** ↑ ↑ ↑
  7. * Each of these selectors */
  8. ```
  9. Visit the [Specificity Calculator](https://specificity.keegan.st) for visual representation of selector specificity.
  10. This rule ignores selectors with variable interpolation (`#{$var}`, `@{var}`, `$(var)`).
  11. This rule resolves nested selectors before counting the specificity of a selector. Each selector in a [selector list](https://www.w3.org/TR/selectors4/#selector-list) is evaluated separately.
  12. ## Options
  13. `string`: Maximum specificity allowed.
  14. Format is `"id,class,type"`, as laid out in the [W3C selector spec](https://drafts.csswg.org/selectors/#specificity-rules).
  15. For example, with `"0,2,0"`:
  16. The following patterns are considered violations:
  17. <!-- prettier-ignore -->
  18. ```css
  19. #foo {}
  20. ```
  21. <!-- prettier-ignore -->
  22. ```css
  23. .foo .baz .bar {}
  24. ```
  25. <!-- prettier-ignore -->
  26. ```css
  27. .foo .baz {
  28. & .bar {}
  29. }
  30. ```
  31. <!-- prettier-ignore -->
  32. ```css
  33. .foo {
  34. color: red;
  35. @nest .baz .bar & {
  36. color: blue;
  37. }
  38. }
  39. ```
  40. The following patterns are _not_ considered violations:
  41. <!-- prettier-ignore -->
  42. ```css
  43. div {}
  44. ```
  45. <!-- prettier-ignore -->
  46. ```css
  47. .foo div {}
  48. ```
  49. <!-- prettier-ignore -->
  50. ```css
  51. .foo div {
  52. & div a {}
  53. }
  54. ```
  55. <!-- prettier-ignore -->
  56. ```css
  57. .foo {
  58. & .baz {}
  59. }
  60. ```
  61. <!-- prettier-ignore -->
  62. ```css
  63. .foo {
  64. color: red;
  65. @nest .baz & {
  66. color: blue;
  67. }
  68. }
  69. ```
  70. ## Optional secondary options
  71. ### `ignoreSelectors: ["/regex/", /regex/, "string"]`
  72. Given:
  73. ```
  74. [
  75. "0,2,0",
  76. {
  77. ignoreSelectors: [":global", ":local", "/my-/"]
  78. }
  79. ]
  80. ```
  81. The following patterns are _not_ considered violations:
  82. <!-- prettier-ignore -->
  83. ```css
  84. :global(.foo) .bar {}
  85. ```
  86. <!-- prettier-ignore -->
  87. ```css
  88. :local(.foo.bar)
  89. ```
  90. <!-- prettier-ignore -->
  91. ```css
  92. :local(.foo, :global(.bar).baz)
  93. ```
  94. The following patterns are considered violations:
  95. <!-- prettier-ignore -->
  96. ```css
  97. :global(.foo) .bar.baz {}
  98. ```
  99. <!-- prettier-ignore -->
  100. ```css
  101. :local(.foo.bar.baz)
  102. ```
  103. <!-- prettier-ignore -->
  104. ```css
  105. :local(.foo, :global(.bar), .foo.bar.baz)
  106. ```