- From: Bert Bos <bert@w3.org>
- Date: Mon, 07 May 2007 11:34:13 -0600
- To: www-style CSS <www-style@w3.org>
Christoph Päper wrote:
>
> Dão Gottwald, 2007-05-07 in www-html + public-html (Re: Cleaning House):
>> Benjamin Hawkes-Lewis schrieb:
>>
>>> If AT had better support for CSS, and CSS had style selectors, we'd
>>> be in a slightly happier place:
>>
>> Ah, style selectors once again ...
>>
>> :style("font-style:normal") {
>> font-style: italic;
>> }
>> :style("font-style:italic") {
>> font-style: normal;
>> }
>>
>> See what happens?
>
> You are right, this cannot work, but
>
> foo {
> font-style: italic;
> font-style: toggle(italic, normal);
> }
>
> or some such might, although this still wouldn't give me the possibility
> to tie italics to serif fonts, boldface to sans-serif fonts, underlining
> to handwriting (cursive) fonts and uppercase to monospaced fonts to
> render emphasis.
Correct, but the toggle() actually makes a good chance for CSS3, except
that the WG prefers to call it cycle() instead, because there may be
more than two values. 'font-style: cycle(italic, normal)' would use
italic if the parent was normal and vice-versa. In general,
cycle(v[0], v[1],... v[n-1])
means to use the value v[i+1 mod n] if the inherited value if v[i].
It's useful for emphasized text inside italic text, but also for cycling
through list bullets, without having to write lots of selectors.
Bert
--
Bert Bos ( W 3 C ) http://www.w3.org/
http://www.w3.org/people/bos W3C/ERCIM
bert@w3.org 2004 Rt des Lucioles / BP 93
+33 (0)4 92 38 76 92 06902 Sophia Antipolis Cedex, France
Received on Monday, 7 May 2007 17:34:24 UTC