Re: [css3-selectors] Grouping

On Fri, Jan 8, 2010 at 12:31 PM, Brad Kemper <brad.kemper@gmail.com> wrote:
> Well that's the way I thought of it, but it seems unusual to have a pseudo-class that only works with the universal selector (in the simple case, anyway, your attribute selector variation aside). With ':checked' and with others, authors are accustomed to attaching pseudo-classes to simple selectors. I suspect that attaching them to emptiness or the universal selector is much less intuitive to many. Which is why I somewhat preferred Nikita's solution of just indicating a grouping in the grammar.

There are other things to attach it to.  Frex, in my company's website
I style the section-nav slightly differently based on what section
you're in.  Some of the sections share colors, though, so I'd like to
do something like this:

#left-nav:any(.about-us,.training) a.level2 {}

>> The second example isn't nonsense, the :any() just isn't adding
>> anything to the existing element selector.  The selector will only
>> match <div>s.
>
> That seems even less obvious.

Really?  The selector first says it must match a div, and then says
that it has to be a div or a span.  Obviously only divs fit those two
criteria.

~TJ

Received on Friday, 8 January 2010 18:39:41 UTC