W3C home > Mailing lists > Public > www-style@w3.org > April 2015

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

From: Florian Rivoal <florian@rivoal.net>
Date: Thu, 30 Apr 2015 00:33:59 +0200
Cc: www-style@w3.org
Message-Id: <33261FE2-7DBB-4A86-A116-428B18FB3E9A@rivoal.net>
To: Manuel Strehl <svg@manuel-strehl.de>

> 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

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:39:30 UTC