[CSS 3] Feature Request: Negotiation selector

Hello.

It would be very helpful to have a negotiation selector in CSS. I’ll give
you a short example how my website should look like:

All headers h1 and h2 should be underlined, uppercase and have a font size
of 100% (normal text will be smaller, but that doesn’t matter) and a
letter-spacing of, let’s say 0.3em.
But these rules must not belong to h1 elements on the login page (on that
page all contents are placed into a <div class=”login”></div> element), but
they should have normal size for h1, no underline, no letter-spacing, no
uppercase,  but have a different color and a font-style italic.

For this example, I have to write the following CSS:

h1, h2 {
      font-size: 100%;
      text-decoration: underline;
      /* … other rules */
}

..login h1 {
                font-size: /* which is the normal font-size for h1?? */
                text-decoration: none;
      font-style: italic;
                /* … other rules */
}

So, there we have the first problem, resetting some values to their default.
Inherit doesn’t work here. The solution for this can be a negotiation
selector, with which the CSS like this:

h1, h2, <not> .login h1, h3 {
      font-size: 100%;
      text-decoration: underline;
      /* … other rules */
}

..login h1 {
                /* here we need only the rules which differ from defaults…
*/
      font-style: italic;
                /* … other rules */
}

What does the line with the selector do resp. mean:
       h1, h2, <not> .login h1, h3
It means: (Try to) Apply the following rules to all elements selected by h1,
h2 and h3, but not to elements selected by .login h1. So the <not> selector
means that the rules should not be applied to the current selector in the
selector list (until the next comma which is the selector delimiter.

In my sample <not> is a placeholder for the negotiation selector which could
be the word not as a keyword, the exclamation mark ! like in (c-related)
programming languages or whatever you find meaningful to the users. It
should be placed preceding the type or universal selector only.

Kind Regards

Marco von Frieling

Received on Saturday, 18 November 2006 00:08:21 UTC