css-validator
css-validator copied to clipboard
False errors "The types are incompatible" and "Invalid type"
Hello!
Code like this gives wrong error messages (IMHO):
x { --y: max(1 * var(--a), var(--b)) } /* "The types are incompatible" */
x { --y: max(var(--c), 1 * var(--d)) } /* "Invalid type" */
x { --y: max(2 * var(--e), var(--f)) } /* "The types are incompatible" */
x { --y: max(var(--g), var(--h) * 1) } /* "Invalid type" */
x { --y: max(-1 * var(--h)) } /* (sometimes?) "Invalid type" */
Testcase from above: https://peter-hindelang.de/x.css Real-world example: https://peter-hindelang.de/Bilder/style.css
Thanks! j.j.
It is indeed related to handling variable types, which has been done in calc() but not here.
Note that having default value (then types) is a way to temporarily fix this.
x { --y: max(1 * var(--a, 2em), var(--b, 42px)) } is shown as valid as the defaulted types are matching.
https://peter-hindelang.de/Bilder/style.css
... btw and while we are here:
At least @font-face { size-adjust: ... } and probably poiner-events: none shouldn't be errors.
Edit: I see now that "pointer-events" depends on profile.