Re: [css-flexbox] Summary of planned changes to Flexbox Module

"Tab Atkins Jr." <jackalmage@gmail.com> wrote:

> On Tue, May 11, 2010 at 5:46 PM, Zack Weinberg
> <zweinberg@mozilla.com> wrote:
> > TeX allows infinitely stretchable negative glue (more or less
> > equivalent to negative flex) and it is quite useful under some
> > circumstances, although its box model is different enough that I
> > won't claim it'd definitely be useful in CSS.
> 
> What does negative glue do in TeX?

Basically the same thing that negative margins do in CSS.  For instance
(from _TeX by Topic_): given

\def\llap#1{\hbox to 0pt{\hskip 0pt plus1fil minus1fil\relax #1}}

then \llap{...} will set '...' right-justified against the current
horizontal position, overlapping whatever happens to be left of that.
It's possible for the expansion of the macro argument #1 to itself
have negative width, in which case it would be left-justified against
the current horizontal position and overlap whatever came after.

(There are additional complications because 'shrink' and 'negative
stretch' are not the same thing, and because 1fill is infinitely more
expandable than 1fil, but I doubt we need to import them.)

> > Speaking of glue, though, I'm pretty sure people *would* find use
> > for a CSS equivalent of "2pt plus4pt minus1pt" (i.e. "try to make
> > this 2pt wide, but you can stretch it up to 6pt or squash it down
> > to 1pt if that makes things fit better").
> 
> Flexbox allows that possibility for at least some things, as
> max/min-width/height and possibly padding/margin with the max() and
> min() functions.  Font-size probably needs that as well, and those
> sorts of constraints are being discussed as part of text-align-last.
> 
> Are there any other parts of CSS that could benefit from this sort of
> approach?

No idea, sorry.  But I'm generally in favor of generality.

zw

Received on Wednesday, 12 May 2010 02:36:55 UTC