-
Notifications
You must be signed in to change notification settings - Fork 757
Description
The css-align spec (the canonical definition for align-self) is pretty unequivocal about how to handle align-self:auto. Quoting:
The
autokeyword computes to the computed value ofalign-itemson the parent ornormalif the box has no parent.
https://drafts.csswg.org/css-align/#propdef-align-self
But, the flexbox & grid specs attempt to define some special-case behavior for this auto value on absolutely-positioned elements -- and IMO they're too vague about how/where that special case behavior is supposed to be triggered, and how broadly its effects spread.
The language I'm concerned about is here in the flexbox spec:
For this purpose, a value of
align-self: autois treated identically tostart.
https://drafts.csswg.org/css-flexbox-1/#abspos-items
...and here in the grid spec:
For the purpose of calculating this static position, a value of
autoforalign-self/justify-selfbehaves asstart.
https://drafts.csswg.org/css-grid-1/#static-position
Superficially, the phrase "a value of" is too vague. (Is that "a specified value"? "a computed value"? something in between?) And of course, "behaves as" is vague too.
I have these specific questions/concerns:
-
Are the flex/grid specs are trying to redefine the computed value of
align-self:autofor these abspos elements? Or isalign-self:autostill intended to compute the way that css-align defines it (to the parent's computedalign-items) and then its computed value (e.g.centerif the parent hasalign-items:center) should somehow produce different layout behavior than it normally would? -
If the intent for (1) is the latter (i.e. if
autocomputes away but then ends up somehow producing different results in layout), how is the different behavior intended to be triggered? Layout uses computed/used values of css properties -- so ifautogets computed away, then I don't see how layout would be able to realize that it needs to apply this special-case behavior. Maybe e.g. whenautocomputes tocenter, it's expected to really compute to a specialcenter-which-really-came-from-autovalue, which is expected to behave just likecenterexcept in this special abspos case? -
It's not clear to me what should happen here when an
align-self:autovalue is inherited to an abspos element. For example: suppose an abspos element inside of a flex container hasalign-self:inherit, and its parent hasalign-self:auto, and its grandparent hasalign-items:center. I'm pretty sure this abspos element should end up with a computedalign-selfofcenter, BUT: is that reallycenter, or is it thecenter-which-came-from-autoscenario discussed above in (2)? (This matters for layout -- if we inherit the purecentervalue, the static position would be center-aligned. But if we inherit some magically taintedcenter-which-came-from-autovalue, then the static position would be start-aligned.)