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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. # function-calc-no-invalid
  2. Disallow an invalid expression within `calc` functions.
  3. <!-- prettier-ignore -->
  4. ```css
  5. .foo {width: calc();}
  6. /** ↑
  7. * empty expression */
  8. .foo {width: calc(100% 80px);}
  9. /** ↑
  10. /* missing operator */
  11. .foo {width: calc(100% -80px);}
  12. /** ↑
  13. /* missing operator */
  14. .foo {width: calc(100% - - 80px);}
  15. /** ↑
  16. /* unexpected operator */
  17. .foo {width: calc(100% -);}
  18. /** ↑
  19. /* unexpected operator */
  20. .foo {width: calc(- 100%);}
  21. /** ↑
  22. /* unexpected operator */
  23. .foo {width: calc(100% / 0);}
  24. /** ↑ ↑
  25. /* division by zero */
  26. .foo {width: calc(100px + 80);}
  27. /** ↑ ↑ ↑
  28. /* the `resolved type` is invalid */
  29. .foo {width: calc(100% + 80);}
  30. /** ↑ ↑ ↑
  31. /* the `resolved type` is invalid */
  32. .foo {width: calc(100px - 80);}
  33. /** ↑ ↑ ↑
  34. /* the `resolved type` is invalid */
  35. .foo {width: calc(100px * 80px);}
  36. /** ↑ ↑ ↑
  37. /* the `resolved type` is invalid */
  38. .foo {width: calc(100 / 80%);}
  39. /** ↑ ↑ ↑
  40. /* the `resolved type` is invalid */
  41. ```
  42. - `calc()` must have an expression.
  43. - `calc()` must have an operator between the arguments.
  44. - `calc()` must not be division by zero.
  45. - [The resolved type](https://www.w3.org/TR/css-values-3/#calc-type-checking) must be valid for where the expression is placed.
  46. ## Options
  47. ### `true`
  48. The following patterns are considered violations:
  49. <!-- prettier-ignore -->
  50. ```css
  51. .foo {width: calc();}
  52. ```
  53. <!-- prettier-ignore -->
  54. ```css
  55. .foo {width: calc(100% 80px);}
  56. ```
  57. <!-- prettier-ignore -->
  58. ```css
  59. .foo {width: calc(100% - - 80px);}
  60. ```
  61. <!-- prettier-ignore -->
  62. ```css
  63. .foo {width: calc(100% / 0);}
  64. ```
  65. <!-- prettier-ignore -->
  66. ```css
  67. .foo {width: calc(100px + 80);}
  68. ```
  69. The following patterns are _not_ considered violations:
  70. <!-- prettier-ignore -->
  71. ```css
  72. .foo {width: calc(100% - 80px);}
  73. ```
  74. <!-- prettier-ignore -->
  75. ```css
  76. .foo {width: calc(100% - var(--bar));}
  77. ```
  78. <!-- prettier-ignore -->
  79. ```css
  80. .foo {width: calc(var(--bar) - var(--baz));}
  81. ```