Problem
The "One operand must be a number" (operandnumber) is incorrectly reported for CSS variable calculations that contain numeric values.
Replicate
- Go to https://validator.w3.org/nu/#textarea
- Check the "CSS" box
- Insert the following CSS into the box
- Receive an error "One operand must be a number"
The CSS to insert into the text box:
.emoji-picker {
--emoji-size: 1em;
--content-height: calc(var(--emoji-size) * 1em);
}
This is a simplified version of the source CSS from the @joeattardi/emoji-button package on this line:
https://github.com/joeattardi/emoji-button/blob/ef8ac84e19ff7f76c955882f7dfe2acc794d1fdb/css/emoji-button.css#L72
Additional details
It seems this has broken rather recently because the same project which is validating HTML through the nu validator has successful builds for the same tests containing the same CSS on the same page 6 days ago (2021-12-03T12:45:40Z).
It also seems the NPM package has not received any updates within those 6 days (latest release 4.6.2 at 2021-11-25T03:57:10.566Z), so the next thing to inspect is the CSS validator which has received recent updates (validator-nu branch).
Problem
The "One operand must be a number" (
operandnumber) is incorrectly reported for CSS variable calculations that contain numeric values.Replicate
The CSS to insert into the text box:
This is a simplified version of the source CSS from the
@joeattardi/emoji-buttonpackage on this line:https://github.com/joeattardi/emoji-button/blob/ef8ac84e19ff7f76c955882f7dfe2acc794d1fdb/css/emoji-button.css#L72
Additional details
It seems this has broken rather recently because the same project which is validating HTML through the nu validator has successful builds for the same tests containing the same CSS on the same page 6 days ago (2021-12-03T12:45:40Z).
It also seems the NPM package has not received any updates within those 6 days (latest release 4.6.2 at 2021-11-25T03:57:10.566Z), so the next thing to inspect is the CSS validator which has received recent updates (
validator-nubranch).