W3C home > Mailing lists > Public > www-style@w3.org > February 2012

[css3-flexbox] "inherit" as the preferred size subcomponent of "flex" property

From: Daniel Holbert <dholbert@mozilla.com>
Date: Fri, 24 Feb 2012 17:36:04 -0800
Message-ID: <4F483B04.4040106@mozilla.com>
To: www-style <www-style@w3.org>
Hi www-style,

Is it intended that "inherit" be allowed as the preferred-size component 
of "flex"?  That is to say, is this style valid:

   flex: 1 0 inherit;

I submit "please no" as an answer.  If "inherit" were allowed there, 
it'd make style-computation more complex, since it takes extra work to 
figure out what value should be inherited by that subcomponent (width or 
height, depending on whether we're horizontal or vertical).

(The "auto" keyword is superficially similar, but it's a bit easier 
because it corresponds to another property on the _same_ element, rather 
than one on its parent -- and it's a single special-case.  Inherit would 
require additional special-case code)

Also, as far as I know, "inherit" isn't allowed as part of a compound 
value anywhere else in CSS . (please correct me if I'm wrong on that 
point.)  It'd be confusing to allow it as a subcomponent here but 
nowhere else.

I think the spec needs a clarification on this -- right now, it says the 
     <preferred-size> is any value that would be valid
     in the ‘width’ or ‘height’ property.
which implies that inherit _would_ be allowed.

Received on Saturday, 25 February 2012 01:36:33 UTC

This archive was generated by hypermail 2.4.0 : Friday, 25 March 2022 10:08:12 UTC