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

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 UTC