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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. # no-duplicate-selectors
  2. Disallow duplicate selectors within a stylesheet.
  3. <!-- prettier-ignore -->
  4. ```css
  5. .foo {} .bar {} .foo {}
  6. /** ↑ ↑
  7. * These duplicates */
  8. ```
  9. This rule checks for two types of duplication:
  10. - Duplication of a single selector with a rule's selector list, e.g. `a, b, a {}`.
  11. - Duplication of a selector list within a stylesheet, e.g. `a, b {} a, b {}`. Duplicates are found even if the selectors come in different orders or have different spacing, e.g. `a d, b > c {} b>c, a d {}`.
  12. The same selector _is_ allowed to repeat in the following circumstances:
  13. - It is used in different selector lists, e.g. `a {} a, b {}`.
  14. - The duplicates are determined to originate in different stylesheets, e.g. you have concatenated or compiled files in a way that produces sourcemaps for PostCSS to read, e.g. postcss-import.
  15. - The duplicates are in rules with different parent nodes, e.g. inside and outside of a media query.
  16. This rule resolves nested selectors. So `a b {} a { & b {} }` counts as a violation, because the resolved selectors end up with a duplicate.
  17. ## Options
  18. ### `true`
  19. The following patterns are considered violations:
  20. <!-- prettier-ignore -->
  21. ```css
  22. .foo,
  23. .bar,
  24. .foo {}
  25. ```
  26. <!-- prettier-ignore -->
  27. ```css
  28. .foo {}
  29. .bar {}
  30. .foo {}
  31. ```
  32. <!-- prettier-ignore -->
  33. ```css
  34. .foo .bar {}
  35. .bar {}
  36. .foo .bar {}
  37. ```
  38. <!-- prettier-ignore -->
  39. ```css
  40. @media (min-width: 10px) {
  41. .foo {}
  42. .foo {}
  43. }
  44. ```
  45. <!-- prettier-ignore -->
  46. ```css
  47. .foo, .bar {}
  48. .bar, .foo {}
  49. ```
  50. <!-- prettier-ignore -->
  51. ```css
  52. a .foo, b + .bar {}
  53. b+.bar,
  54. a
  55. .foo {}
  56. ```
  57. <!-- prettier-ignore -->
  58. ```css
  59. a b {}
  60. a {
  61. & b {}
  62. }
  63. ```
  64. The following patterns are _not_ considered violations:
  65. <!-- prettier-ignore -->
  66. ```css
  67. .foo {}
  68. @media (min-width: 10px) {
  69. .foo {}
  70. }
  71. ```
  72. <!-- prettier-ignore -->
  73. ```css
  74. .foo {
  75. .foo {}
  76. }
  77. ```
  78. <!-- prettier-ignore -->
  79. ```css
  80. .foo {}
  81. .bar {}
  82. .foo .bar {}
  83. .bar .foo {}
  84. ```
  85. <!-- prettier-ignore -->
  86. ```css
  87. a b {}
  88. a {
  89. & b,
  90. & c {}
  91. }
  92. ```
  93. ## Optional secondary options
  94. ### `disallowInList: true | false` (default: `false`)
  95. This option will also disallow duplicate selectors within selector lists.
  96. For example, with `true`.
  97. The following patterns are considered violations:
  98. <!-- prettier-ignore -->
  99. ```css
  100. input, textarea {
  101. border: 2px;
  102. }
  103. textarea {
  104. border: 1px;
  105. }
  106. ```