Since many people apparently didn’t read TFA, the issue is that when you have an expression such as calc(100% - var(—-x)), it is invalid if var(—-x) is 0 with no units, which is otherwise valid in CSS. This is clearly a bug in the spec.
To be honest this isn't that strange, the parser needs to know what denomination you're trying to subtract.. Also as per the spec the `-` operand requires a whitespace. So it's not actually valid to use (100& -0) you're getting a false positive..<p><a href="https://developer.mozilla.org/en-US/docs/Web/CSS/calc#notes" rel="nofollow">https://developer.mozilla.org/en-US/docs/Web/CSS/calc#notes</a>
From MDN<p>"For lengths, you can't use 0 to mean 0px (or another length unit); instead, you must use the version with the unit: margin-top: calc(0px + 20px); is valid, while margin-top: calc(0 + 20px); is invalid."<p><a href="https://developer.mozilla.org/en-US/docs/Web/CSS/calc?retiredLocale=de" rel="nofollow">https://developer.mozilla.org/en-US/docs/Web/CSS/calc?retire...</a>
Indirect post of <a href="https://www.oddbird.net/2022/08/04/zero-units/" rel="nofollow">https://www.oddbird.net/2022/08/04/zero-units/</a>
I am a great proponent of the unitless zero pretty much everywhere. I am pleased CSS supports it. An empty chicken shed is just a shed.<p>Sadly here it does force a special case where it either becomes a nop or it adopts the units required. Not sure which is best.