Re: [csswg-drafts] [css-values][css-images] Unit algebra with `<flex>` in `stripes()` leads to a contradiction (#9667)

> The definition basically says that <flex> values cannot be used in calc() expressions.

No, I think you're misreading/misunderstanding.

Flex values are not compatible with lengths; you can't add them together. But you *can* use flex values in an expression with lengths, so long as you never actually combine it with a length value in a way that uses type addition. So `1fr / 1fr * 1px` is completely valid (final type `{flex: 0, length: 1}`, matches `<length>`), but `1fr + 1px` is invalid (type addition notices each has non-zero types that aren't present in the other, so fails).

> So you suggest the result of the example to be 50px, 50px, 0 due to the two fr units cancelling each other out?

That is what I'd *naively* expect, and it might be reasonable to fix the spec to allow it, yes. I haven't been able to fully think it thru yet, tho.

-- 
GitHub Notification of comment by tabatkins
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/9667#issuecomment-1847992477 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Saturday, 9 December 2023 00:09:38 UTC