Re: [css3-flexbox] Computed value and flex-align/flex-item-align.

On Fri, Jan 27, 2012 at 2:25 AM, Boris Zbarsky <bzbarsky@mit.edu> wrote:
> On 1/27/12 3:52 AM, Alex Mogilevsky wrote:
>>
>> ± From: Tab Atkins Jr. [mailto:jackalmage@gmail.com]
>> ± Sent: Thursday, January 26, 2012 5:27 PM
>> ±
>> ± Computed values are evaluated as far as possible based solely on the
>> value
>> ± of other properties in the document, without relying on layout
>> ± information.  'flex-item-align:auto' can be resolved based solely on the
>> ± value of 'flex-align' on the parent, so it should be resolved at
>> computed-
>> ± value time.
>>
>> It sounds like I will have to add special code just to make
>> getComputedStyle() happy.
>
> It's not just getComputedStyle.  The computed value is also observable via
> use of "inherit" on children.  And this aspect is more important, imo.
>
> So the real question should be:  What should happen if a child inherits from
> an element with specified "flex-item-align: auto"?  Should it inherit
> "auto", or should it inherit something else?
>
> Note that there may be good reasons to inherit as "auto", in which case the
> computed value should be "auto".  There's nothing that says computed values
> have to be as resolved as you can get; what they _should_ be is whatever
> makes the most sense to inherit.

I've thought about it a bit, and I don't think there's any good reason
for 'inherit' to see ''auto''.

If your parent's flex-item-align is set to a non-auto value, using
'inherit' ensures that you're aligned the same way as they are: if
they're start-aligned in their flexbox, you'll be start-aligned; if
they're end-aligned, you'll be end-aligned.    This seems potentially
useful.  However, if 'auto' inherits as 'auto', this relationship
breaks - you'll now align according to your parent's 'flex-align'
property, which can be different than their actual alignment.  So,
'auto' should inherit as the alignment it corresponds to.

~TJ

Received on Friday, 27 January 2012 16:48:58 UTC