RE: font-style: toggle-italic

On Wed, 22 Mar 2000 JOrendorff@ixl.com wrote:

> Jonny Axelsson wrote:
> > I haven't yet had any use for this personally. If say the B element is
> > presented as italic, and so is everything inside an "intro" 
> > DIV, the "first
> > level" style sheet is
> > 
> >    div.intro {font-style:italic}
> >    b {font-style:italic}
> > 
> > I have then added
> > 
> >    div.intro b {font-style:normal}

I believe this issue has been raised before (I can't find the postings).
If I recall correctly, the conclusion was that 'toggle' is insufficient,
since there are other properties you might like to do this with that
aren't bi-modal (even font-style isn't, which has normal, italic, and
oblique), and you might actually want to _cycle_ through the values, as
opposed to toggle between two values.

One option would be a macro function, as in:

font-style: cycle(normal,oblique,italic);

and so on [At this point I am making up stuff -- none of this is based on
any previous messages on this topic, as I can't find them ].  The CSS
processor would then match the inherited style, and set the curent value
to the next one in the cycle.

But this gets messy for two reasons.  THe first problem is when the
property values ar relative, and thus not always well-defined. For
example, a statement like

font-weight: cycle (bold, bolder, 700);

is ok, but might be confusing, since only bold and 700 are absolute
values, while 700 is relative.

A second problem occurs when the cycle doesn't match any inherited
value. For example, what do you do if you have

font-style: cycle(normal,oblique);

but the inherited style is italic. Things still work, of course, but it
is confusing.   

It would get even worse with font families, where there is no way to know
what the inherited value will be....

Of course, what you _might_ want to do is set styles conditionally based
on inherited onces -- that is, set font-weight: bold only if font-style:
italic.  I do not know if that has ever been discussed, although it is an
obvious extension.

Ian
--
http://www.utoronto.ca/ian/

Received on Thursday, 23 March 2000 12:29:15 UTC