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.
Philipp Partosch 46a936d7de added all files to project 2 years ago
..
README.md added all files to project 2 years ago
index.js added all files to project 2 years ago

README.md

function-calc-no-invalid

Disallow an invalid expression within calc functions.

.foo {width: calc();}
/**               ↑
 * empty expression */
.foo {width: calc(100% 80px);}
/**                   ↑
/* missing operator */
.foo {width: calc(100% -80px);}
/**                   ↑
/* missing operator */
.foo {width: calc(100% - - 80px);}
/**                      ↑
/* unexpected operator */
.foo {width: calc(100% -);}
/**                    ↑
/* unexpected operator */
.foo {width: calc(- 100%);}
/**               ↑
/* unexpected operator */
.foo {width: calc(100% / 0);}
/**                    ↑ ↑
/* division by zero */
.foo {width: calc(100px + 80);}
/**                  ↑  ↑  ↑
/* the `resolved type` is invalid */
.foo {width: calc(100% + 80);}
/**                  ↑ ↑  ↑
/* the `resolved type` is invalid */
.foo {width: calc(100px - 80);}
/**                  ↑  ↑  ↑
/* the `resolved type` is invalid */
.foo {width: calc(100px * 80px);}
/**                  ↑  ↑   ↑
/* the `resolved type` is invalid */
.foo {width: calc(100 / 80%);}
/**                 ↑ ↑   ↑
/* the `resolved type` is invalid */
  • calc() must have an expression.
  • calc() must have an operator between the arguments.
  • calc() must not be division by zero.
  • The resolved type must be valid for where the expression is placed.

Options

true

The following patterns are considered violations:

.foo {width: calc();}
.foo {width: calc(100% 80px);}
.foo {width: calc(100% - - 80px);}
.foo {width: calc(100% / 0);}
.foo {width: calc(100px + 80);}

The following patterns are not considered violations:

.foo {width: calc(100% - 80px);}
.foo {width: calc(100% - var(--bar));}
.foo {width: calc(var(--bar) - var(--baz));}