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

[css] the 'flow' and flex units

From: Andrew Fedoniouk <andrew.fedoniouk@live.com>
Date: Sat, 26 Feb 2011 11:38:10 -0800
Message-ID: <BLU159-ds152F31FA1A4CC6592685AF8DC0@phx.gbl>
To: <www-style@w3.org>
I've updated my proposal for flex units and the 'flow' in CSS:
http://www.terrainformatica.com/w3/flex-layout/flex-layout.htm

Just two additions:

1) "template" flow can use ordinals of child elements now. So if you have 
this markup:

<li><p>A</p>
      <p>B</p>
      <p>C</p></li>

Then after defining in CSS the following:
li {
  flow: "1 1"
        "2 3";
}
content of each list item will have two rows with
first element (A) spanning whole first row and
with B,C elements in second row.

Pretty handy and self descriptive for simple cases when
there are just few children.

2) The Flex Algorithm.

The document contains link to the implementation of algorithm
used for computation of sets of flexible and non-flexible values.
It is in C++ but code is straightforward - core of the calc() function
is about 50 lines of code. The implementation is using only integer
arithmetic so pretty stable and can be used effectively on low-end
devices.

In fact this algorithm is used in many places in HTML/CSS even without
flex units per se, for example:
1) computation of 'auto' widths and margins in blocks,
2) tables - computation of column/rows distributions,
3) frameset layouts, etc.

At the moment the algorithm is BSD-licensed - please let me know if
this not permissive enough. I am not that good in "legaleze".

If any dev team designing rendering engines wants me to help with
integrating all this - please let me know I am open at the moment for
interesting offers.

-- 
Andrew Fedoniouk

Terra Informatica Software, Inc.

http://terrainformatica.com
mailto: andrew at terrainformatica.com 
Received on Saturday, 26 February 2011 19:38:49 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:20:37 GMT