Re: min-font-size

On Wed, 14 Jul 1999, George Lund wrote:

> I'd like to propose a new property called min-font-size.  
> Max-font-size could be useful (though less so) as well.

This has already been suggested (by David Baron).

One problem with this suggestion is that the logical extention is to have
min- and max- versions of every other numeric property, something which
would nearly double the total number of properties in CSS. This, BTW, is
not a good thing.

It also means that many, _many_ new rules have to be thought up to
coordinate how all these numbers interact.

An alternative idea, which has been talked about in the past in other
lists (and which, I believe, was also suggested by David Baron) is to
introduce two new declarations similar to !important: !minimum and
!maximum. These would have a subtly and carefully crafted effect on 
the cascade so that the correct value was always chosen.

An example of how this could be used is:

   * { font-size: 9px ! minimum; font-size: 200% ! maximum; }

...which would imply that no element can have text smaller than 9px, and
no element can have text bigger than twice its parents font-size.

This would extend very simply to cover things like border sizes:

   BOX { border-width: 1em; border-width: 8px ! maximum; }

It would also allow the reformulation of min-width and min-height into a
more generic mould:

   .float { float: right; width: 20em; font-size: 80%;
            width: 25% ! maximum; width: 10% ! minimum; }

This could also be used to size columns, or choose a number of columns,
dynamically (based on the size of the viewport). It would also be
extremely useful in user stylesheets.

Unfortunately, to my knowledge noone has as yet worked out a suitable set
of rules to make the cascade work well with !maximum and !minimum. (I do
not know if anyone has even tried).

-- 
Ian Hickson
: Is your JavaScript ready for Nav5 and IE5?
: Get the latest JavaScript client sniffer at 
: http://developer.netscape.com/docs/examples/javascript/browser_type.html

Received on Saturday, 17 July 1999 15:48:13 UTC