Re: Enhancing grouping of selectors

On 9/17/10, Paul Duffin <pduffin@volantis.com> wrote:
> I am not sure whether this is the correct forum to propose enhancements to
> CSS, if not I apologize and just ask that you redirect me to the correct
> place.
>
> CSS selectors are very powerful but sometimes they can be quite verbose,
> especially when using combinators such as child and descendant which often
> involve a lot of repetition, e.g.
>
> .foo > .blah > a,
> .foo > .blah > a:hover,
> .foo > .blah > a:visited,
> .bar > .blah > a,
> .bar > .blah > a:hover,
> .bar > .blah > a:visited { /*properties*/ }
>
> The above are simplified versions of real selectors, and there is no way to
> simplify them without adding extra information (e.g. classes) into the
> markup being styled, whose only purpose would be to simplify the CSS.
>

[...]

> What do you think?
Odd to use "foo" and "blah" in real code.

Aside from that, it always seemed like a good idea to have a way to
get a "selectorGroup" from a CSSRule as something like a DOMTokenList.

.foo, .bar {

}

sheet.cssRules[0].selectorGroup

But DOMTokenList says the delimiter is one or more space characters
(not comma). Actually the whole API for traversing stylesheets is bad.
Needs a whole new API.

Received on Thursday, 24 March 2011 17:04:45 UTC