Re: CSS3: font-style

Andrew n marshall wrote:


> So let me take a moment to draw attention to the problem:
>   Because CSS is by definition a >>cascading<< stylesheet language, style
> designers are required to make assumptions about default style for every
> user, as well as the inherited style attributes for every instance of a
> style.  In some of these cases, such as "font-style:italics;", there is no
> way around the assumption (the assumption for italics is that the
> surrounding text is not in italics).  In other words, not every CSS2
> attribute has an option to define itself relative to it's parent.


Ian Hickson wrote:
> Well, font-style is a special case. With colour, you can set each
> different element to a different colour and then if they are nested
> then there is no problem.


I think I now understand the rationale behind the toggle value, and your
explanations were very helpful. However, I don't think the feature is
specific to having some text in italic. 

I can see two reasons why someone would want to render some text with an
italic font, or red color:

1 - that what you want to have for this particular chunk of text,
because you think it's neat.
2 - you want to emphasize that chunk of text, and you choose a different

In the first case, if the cascade happens to put all the surrounding
text in red or italic, well maybe it won't be that nice after all, but
so be it. That's what CSS does, and if you're not happy with it, use

In the second case, you loose your effect, but still, I don't see a
difference between font-style and colors: if you've decided to emphasize
a portion of text using red or italic, and the cascade happens to make
the surrounding text also or italic red, then why should it be allowed
that italic can be toggled back to normal, and why shouldn't is be
allowed that 'red' be toggled back to the default color (whatever that

And if you compare 'font-style' with 'font-weight', the difference is
that font-weight has relative values, when font-style does not. So maybe
the solution is to add relative values to font-style, like 'more-italic'
and 'less-italic', and the UA will be responsible to render that, just
like they are responsible to render 'bolder' and 'lighter' (and they may
not be able to do that).

and quoting Andrew again:

> Example Problem #1:
> If an end-user sets their local stylesheet to:
>   blockquote { font-style:italics; }
> then the standard
>   em { font-style:italics; }
> fails to serve it purpose (to draw attention by being typed differently)
> in the following example:
>   <blockquote>This is an example of <em>emphasized</em> text.</blockquote>

this is not specific to 'font-style'. There is the same issue if you use
'font-weight: bold'. And someone's gonna say "but people should use
'bolder', not 'bold'". true. But then why is 'bold' in CSS in the first
place ? I bet there are a lot of historical reasons there, but hy not
solve this issue for 'font-tyle' by reusing the solution in place for
'font-weight' ?

> Exactly. That is why this is a good feature. (Maybe what we need is
> not so much "toggle" as "toggle-italic" and "toggle-oblique".)

I know, I'm repeating myself, but if that happens to be a desirable
feature, then I'd like to have toggle-bold, and probably many many other
toggle- values for many other properties. It's not symetrical otherwise.


Received on Thursday, 27 May 1999 17:42:07 UTC