W3C home > Mailing lists > Public > www-style@w3.org > January 2011

[css3-flexbox] intuitivity and width computation rules

From: Jeremie Patonnier <jeremie.patonnier@gmail.com>
Date: Thu, 13 Jan 2011 10:59:33 +0100
Message-ID: <AANLkTikZtk2GH5Rjv8xxstO5ibRh5HeKPP1FrWjGkZEr@mail.gmail.com>
To: www-style@w3.org
Cc: daniel.glazman@disruptive-innovations.com, bzbarsky@MIT.EDU, dbaron@dbaron.org

I've read the whole topic and I which to clarify certain points about web

First, as some of you mention it, the common use case in all the articles
about the flexbox model is how to build a 2:1:1 set of boxes. I agree that
there is a lot of way to handle it with CSS. CSS2 display:table-* plus width
with percentage is maybe the best choice. But it's the best choice only if
you deal with a static layout. In case of a dynamic layout (where you could
add some boxes through JS for exemple), because there is explicits width,
the author have to recalculate the width of each box to prevent an overflow.

That's one of the use case for the flexbox model. Allowing author to give
proprotional width to boxes without knowing the exact number of boxes
available in the final layout.

Second, yes it is possible to use calc to deal with a mix of fixed width
boxes and relative width boxes, but once again, it's only true if the author
can predict the number of boxes in the final layout.

Third even after a close look at the spec, it is not obvious that "width: 0"
is the answer to have flexible width based on the whole parent box width
(fwiw, I know there are smarter people than I, but It needed more than a
year to understand that after a lot of spec reading). And to be franc,
assuming that web author should know that they have to set a width is far
from the reality of web authoring. Most of the web author I know never read
the spec (for them, I'm some kind of mad man doing that). At best they read
some articles and just use a "try and fail" course of action. If it fail to
much, they drop it and go back to the old "float system and Javascript". In
my opinion, giving them much more intuitive tools, for what is means, is as
important as having clear spec and good implementation. In my experince
(which is some what limited) every people I know imagine that "flexible"
mean no need to specified a width.

Web : http://jeremie.patonnier.net
Twitter : @JeremiePat <http://twitter.com/JeremiePat>
Received on Thursday, 13 January 2011 10:00:07 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 22:49:53 UTC