W3C home > Mailing lists > Public > www-style@w3.org > June 2011

[css3-selectors] feature request

From: Tom <codekiller66@gmail.com>
Date: Fri, 17 Jun 2011 00:57:04 +0100
Message-ID: <0760796DDB1648D89FABF73D13DFA6BA@TomHome>
To: <www-style@w3.org>
For a while now I’ve been thinking it would be extremely handy if CSS had a pseudo class which could, on being affected by the user, trigger styles on another element. It would be a lot like how you can trigger events from parent to child nodes, except with this pseudo class the element could trigger styles on any element in the document.

A syntax I think might work would be, for example:

foo:trigger(bar:hover){/* styles */}

where foo is the trigger element, bar is the element to be effected, hover is the event, and the styles are what the user sees happen to bar. So when you hover over foo, you see the styles within the block affect the element bar. If it were:

foo:trigger(baz:focus){/* styles */}

then giving foo focus would cause the styles to be applied to element baz.

I just think it’s an interesting concept (if it hasn’t already been suggested), since there’s no way in CSS to select to a parent node, but you wouldn’t need to in most style manipulation cases if you had a :trigger pseudo-class.

Tom
Cogito Studios
Received on Friday, 17 June 2011 00:00:05 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:20:41 GMT