Re: [gcpm][grid] border-parts

Also sprach Tab Atkins Jr.:

 > > What would you call it instead? One flex, two flexes? And yes, this
 > > would have to be discussed in the context of grids; I've just imported
 > > the 'fr' unit from there. [grid] added to subject line.
 > 
 > If I had a choice, yeah, I'd go with flexes as the unit, abbreviated fl.

Alex?

 > >  > What happens if you specify fr units within a repeat() expression?
 > >
 > > That would work as long as there are lenghts/percentages there as ell.
 > > The resulting border parts would be very short -- especially in long
 > > borders.
 > >
 > > If the repeat pattern consist of only on fractions, there would be
 > > infinetely many of them. I've added text to make this illegal.
 > 
 > Are you sure that works?  Say I specify border-parts: repeat(1fr 20px).  How
 > many times can this repeat? 

The algorithm is specified in the text:

  The exact border parts are determined by laying out the specified
  border parts with all fractions initially set to zero. The border
  parts specified before and after the 'repeat()' function are laid
  our first. Thereafter, the repeat pattern is inserted between them
  at least once, and as many times as possible without making the sum
  of border parts longer than the border length. Any remaining border
  is split proportionally between the fractions specified.

So, if the border is 42px long, the pattern would repeat twice and
with 1fr=1px; it would be the same as:

  1px 20px 1px 20px

If, however, the border is 40px long, the pattern can also be repeated
twice if the fractions remain zero:

  0 20px 0 20px

Or, one could say that the fractions must have some length (how much?).

I think it's ok for fractions to be zero. If you want the gap to have
a minimal lenght, it can be expressed this way:

  repeat(20px 10px 0 1fr)

No?

-h&kon
              Håkon Wium Lie                          CTO °þe®ª
howcome@opera.com                  http://people.opera.com/howcome

Received on Thursday, 30 October 2008 23:20:33 UTC