-
Notifications
You must be signed in to change notification settings - Fork 636
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[css-values][css-images] Unit algebra with <flex>
in stripes()
leads to a contradiction
#9667
Comments
By this note in the definition of
Sebastian |
That refers to |
Right, whether or not you match a production like |
And so is The contradictory is rather that CSS Values 4 says that Also, why is this specific to the
@tabatkins So you suggest the result of the example to be Sebastian |
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
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. |
I have been thinking further about this, and I believe I was mistaken, because:
|
https://drafts.csswg.org/css-images-4/#stripes
Suppose a total width of 100px, what should happen with
stripes(#000 50px, #111 calc(1fr / 1fr * 50px), #222 1fr)
?<length>
of 50px<length>
ofcalc(1fr / 1fr * 50px)
😓<flex>
of1fr
Then,
1fr
is not zero, the 2nd stripe is 50px thick, and so we distribute100px - 50px - 50px
into1fr
, so the third stripe is 0px thick. So the final thicknesses are50px, 50px, 0px
, but this is a contradiction because we assumed that1fr
wasn't zero.1fr
is zero, the 2nd stripe gets aNaN * px
which is censored into 0px at the top-level calculation. So we distribute100px - 50px - 0px
into1fr
, so the 3rd stripe is 50px thick. So the final thicknesses are50px, 0px, 50px
, but this is a contradiction because we assumed that1fr
was zero.Thus it's a contradiction either way. How to solve it?
The text was updated successfully, but these errors were encountered: