W3C home > Mailing lists > Public > www-style@w3.org > October 2000

Re: selector negation (was Re: New version of the Selectors module of CSS3)

From: fantasai <fantasai@escape.com>
Date: Tue, 10 Oct 2000 19:39:39 -0400
Message-ID: <39E3A8BB.74D13DBC@escape.com>
To: www-style@w3.org
Matthew Brealey wrote:
 | Precisely one argument - one simple selector. Cause !:first-child is
 | not as nicely wrapped up as :!(:first-child). I did consider :not(),
 | but I preferred the briefer syntax.

Is it possible to get rid of the first colon? The two colons seem redundant,
and, as has been pointed out before, negation is not a pseudo-class in 
itself. 

Actually, using a single symbol makes it very easy to adapt the syntax
for all the selections:

A!(:first-child)
A!([href]):hover
!(P) > A

Or if you'd rather not have parentheses:

A!:first-child
A![href]:hover
!P > A

Although, if one wants to get complicated, the parentheses can add powerful
grouping capabilities:

!(DIV.navbar > P) > A

Not to mention they add clarity in terms of the negation's scope whether
or not any grouping is allowed: !P.blurb could mean !(P).blurb or !(P.blurb)
unless you paid close attention to syntax rules & language allowances.

One problem with using ! is that it's used for !important, which does
/not/ mean "not important".

~fantasai
Received on Tuesday, 10 October 2000 19:39:29 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 27 April 2009 13:54:06 GMT