[selectors] Re: CSS selector to better match label elements

> On 30 Apr 2015, at 00:13, Manuel Strehl <svg@manuel-strehl.de> wrote:
> 
> Hello,
> 
> I've been pondering a while over the following suggestion for a new
> selector and, to my surprise, still think it is a necessary tool that is
> missing.
> 
> <label> elements are notoriously hard to select with CSS in any
> non-trivial mark-up structure, when the state of their control is to be
> taken into account.
> 
> [...]
> 
> So I come to... ***drumroll*** ...the proposal:
> 
> A pseudo-class :for() can provide better control over addressing <label>
> elements. Its content must be a single selector or selector list
> (mirroring :not()), that is matched against label.control. The
> specificity of :for() is the specificity of its arguments.
> 
> [...]
> 
> What do you think?

This actually came up recently, and we resolve in favor of adding it.

There's an action on me to write the specification. I haven't got
around writing it yet, but it's on my todo list.

Thanks for describing it in details, this will make it easier to write
down the spec.

 - Florian

Received on Wednesday, 29 April 2015 22:34:23 UTC