-
Notifications
You must be signed in to change notification settings - Fork 757
Open
Labels
Description
https://drafts.csswg.org/css-images-4/#stripes
A
<flex>is evaluated as a fraction of the total width relative to the total sum of<flex>entries in the function, after subtracting the thickness of any non-<flex>entries (flooring the subtraction result at zero). If the sum of<flex>values is less than1fr, the result of the subtraction is multiplied by the sum’s value before being distributed.
Suppose a total width of 100px, what should happen with stripes(#000 50px, #111 calc(1fr / 1fr * 50px), #222 1fr)?
- 1st stripe is a
<length>of 50px - 2nd stripe is a
<length>ofcalc(1fr / 1fr * 50px)😓 - 3rd stripe is a
<flex>of1fr
Then,
- If we assume that
1fris not zero, the 2nd stripe is 50px thick, and so we distribute100px - 50px - 50pxinto1fr, so the third stripe is 0px thick. So the final thicknesses are50px, 50px, 0px, but this is a contradiction because we assumed that1frwasn't zero. - If we assume that
1fris zero, the 2nd stripe gets aNaN * pxwhich is censored into 0px at the top-level calculation. So we distribute100px - 50px - 0pxinto1fr, so the 3rd stripe is 50px thick. So the final thicknesses are50px, 0px, 50px, but this is a contradiction because we assumed that1frwas zero.
Thus it's a contradiction either way. How to solve it?