RE: min-font-size

On Mon, 19 Jul 1999, Jelks Cabaniss wrote:

> Eric Meyer wrote:
> 
> >      P {font-size: 8pt+ 9pt 12pt-}
> 
> But with the suggestions so far, AFAICT current-generation browsers won't
> understand that they should read that as "font-size: 9pt".

The !minimum/!maximum rule would, so long as the current browsers
correctly implement the grammar and error handling rules of CSS1. 


On Mon, 19 Jul 1999, L. David Baron wrote:

> > Maybe someone should just invent these rules and then we would have
> > something concrete to discuss... ;-)
> 
> Here are the rules I've had in mind - which would be as close to
> compatible with min-width and max-width as possible.  The rules in
> section 6.4.1 of CSS2 [1] would be applied separately to all
> declarations with priority ~= "minimum" and with priority ~= "maximum"
> and other declarations.  Then, to find the computed value of the
> property:
> 
> 1. let max = the computed value computed from the specified value
>   cascaded above for declarations with priority ~= maximum
> 2. let min = ... for declarations with priority ~= minimum
> 3. let comp = ... for declarations not used above
> 4. if comp > max, then let comp = max
> 5. if comp < min, then let comp = min

Yes, this seems to be a good set of rules. Nice.
 
> Problems with this approach:
>   * saying there's no maximum (to override another declaration) would
>     now require a new length value

No big deal: the new length value could be called 'infinity' and would
only apply to !maximum property/value pairs. The minimum equivalent could
be called -infinity.

>   * there might be a better solution than the one currently used
>     for (min|max)-width

Maybe, but it wouldn't be very simple...

> Advantages with this approach:
>   * it exactly mimics the behavior of (min|max)-width
>   * it's easy to give something exactly in a user stylesheet (although
>     perhaps the cascading rules could make this unnecessary):
> 
>       font-size: 20px ! important maximum minimum;

And other advantages are: no new properties, backwards compatible, simple
concept to explain, probably relatively easy to implement, works with the
cascade.


> By the way, I might prefer a syntax such as:
> 
>     min(width): 20%;
> 
> but this is not allowed by the grammar [2]. 

And also it doesn't work very well with the idea of functions -- what you
are doing there is assigning something to a function! 


> Perhaps something like:
> 
>     @minimum {
>       width: 20%;
>     }
> 
> could be acceptable.

It could, but I think using the !xxx syntax is neater.

 
> [1] http://www.w3.org/TR/REC-CSS2/cascade.html#cascading-order
> [2] http://www.w3.org/TR/REC-CSS2/syndata.html#tokenization
 

-- 
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, 28 August 1999 19:03:39 UTC