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

Re: :click pseudo element

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Mon, 7 Feb 2011 13:07:37 -0800
Message-ID: <AANLkTi=SENtBDdvsmkMU3k35kfoU+6w0aVgxruLbzQHv@mail.gmail.com>
To: Tantek Çelik <tantek@cs.stanford.edu>
Cc: Brad Kemper <brad.kemper@gmail.com>, thomasin a <nevereatredjellybeans@gmail.com>, www-style@w3.org
On Mon, Feb 7, 2011 at 10:31 AM, Tantek Çelik <tantek@cs.stanford.edu> wrote:
> On Mon, Feb 7, 2011 at 10:20, Brad Kemper <brad.kemper@gmail.com> wrote:
>> It'd be nice to have a way to replicate radio-button behavior. Something like:
>>
>> a:clicked(odd) { /* on state */ }
>> a:clicked(even) { /* off state */ }
>>
>> ... where only a mouse-up counted as as 'clicked'.
>>
>> Although it would be better if there was some sort of actual binary state that could be attached to any element and styled.
>
> Right.
>
> Once we start talking about user-meaningful (binary) "states" like
> that, we've crossed-over into semantics (meaning of the
> document/page/webapp) and much better to keep/leave that in HTML.
>
> However, once such a state is defined in your markup (i.e. the HTML
> specification defines when which elements are in on/off states), then
> you can use UI Selectors to apply styling to it:
>
> http://www.w3.org/TR/css3-selectors/#UIstates
>
> reworking your sample style sheet:
>
> a { /* off state */ }
> a:checked { /* on state */ }

Agreed with both of you, that this is a valuable addition, and that
it's best to solve this at the HTML level and then let CSS hook into
it.

~TJ
Received on Monday, 7 February 2011 21:08:29 GMT

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