- From: Nicolas Lesbats <nlesbats@etu.utc.fr>
- Date: Thu, 27 May 1999 13:11:33 +0200 (MET DST)
- To: www-style@w3.org
Hi, I do like L. David Baron's proposal, but it seems a bit complex, and it doesn't solve all the problems, as Andrew said. Here are some other ideas on the subject. * My goal is not only to simplify the stylesheets. The problem, for example, of the actual definition of the <em> tag (font-style: italic), is that it's semantically incorrect. What's you want is not to make <em> italic; you want it to contrast with its parent by using the visual difference italic/normal (or oblique/normal). * A problem with the simple 'toggle' value is you don't assure forward compatibility (some people have spoken about some languages which use both italic to the left and italic to the right). So it would be necessary to define between which values you want to toggle. For instance, the Andrew's proposal 'toggle-italic', or more generally 'toggle(italic, normal)' (or 'toggle(oblique, normal)'), where italic would be the default value [ If the parent's value could be determined and if this value is italic => font-style: normal Else => italic The 'inherit' value wouldn't be permitted ] * We must define if toggle is doing between descendant selectors or "adjacent sibling" selectors. Here, it's between descendant selectors, but couldn't there be confusion (it's underlined by JM Leon, I mean) ? We can perfectly imagine a toggle between blue and red for instance in a table with this following rule : tr { color: toggle-in-brotherhood(blue, red) } The correct name is to be found !! ;-) toggle-in-nest.... ??? In opposition, we could name 'toggle-in-tree' (*or other*) the opposite value. * Then, the value becomes very complex, I think a reasonable solution is 'toggle(#1_value, #2_value)'. But in fact, this value becomes very specific, so why not to expand it to other properties, why 'font-style' only ? I answered : take the sample style sheet for HTML 4.0 You will see that it's the only property which have to be relative to his parent and which is not. The 'font-weight' property is relative thanks to the 'bolder' value [as a matter of facts, there is too the <sup> and <sub> elements which won't work correctly in the case <sup><sup></sup></sup> for instance]. The 'toggle' value would allow to make the default stylesheet correct and logical, which is not presently. * Moreover, the value make the maintenance easier (this is a principle of CSS, isn't it ?) : if you pass from body: normal to body: italic, you will have only one line to change. * To reply to the "this can already be done" (which isn't a principle of CSS, right : "there is generally only one way to achieve a certain effect"), I'm not agree. This can be done, but badly. This corresponds to what I have just said. The important is, CSS *must* provide a mechanism to this works better. * The problem of 'toggle' is that CSS would begin to become a kind of scripting language, which is not its goal according to the spec, since the final value will depend on a condition (if()). There is the same problem with David's proposal. We have to clearly determine what CSS must become. * From this point of view, there is another solution : using a script function value like font-style: javascript("toggle(xxx)") where toggle() is a user function. I don't know if javascript can do what I want to do, but I believe it's possible. I had already proposed such a value, and it seems Microsoft had already include a similar value in IE5 for testing, has someone information about it ?). The name of the value would be to discuss, script() or function() would be good, with the scripting language name in settings. An opposed argument is to say that script languages can already have access to style sheets content, but I really think that the contrary is too necessary, because scripts are *tools* to dynamically change the style of a page (in part). In my mind, scripting languages are for CSS what CSS is for HTML. Furthermore, allowing calling a script function would solve a lot of problem of codependance, as determine a color depending on the background-color and/or its parent's color. -> I don't have an advice anymore... I still believe that we could make an exception with the font-style property because of real need ( I speak about it with my own experience, the need of formatting a simple journal text with about 15 elements using the font-style property), but we have to make attention on what CSS will become... What do you think about that, in particular about the function() value? Don't you believe that a mechanism allowing toggling is absolutely necessary, and that it's the role of CSS to provide it ? Nico -- "Et bien tu vois, Stan, les vaches... c'est le mal. Leur coeur noir ne pompe pas du sang comme toi et moi mais un liquide visqueux qui circule dans leurs veines pourries pour irriguer leur cerveau minuscule, ce qui fait qu'elles adoptent un comportement hallucinatoire (danger : soucoupes) et que Dieu les a puni en les envoyant toutes vivre... en Normandie (ou il pleut trois fois plus qu'a Compi...)." ('xcuse-moi, Milou...)
Received on Thursday, 27 May 1999 07:11:38 UTC