Re: [css4-selectors] Focused descendant pseudo class

On 01/25/2012 12:47 PM, Lea Verou wrote:
> On 25/1/12 22:33, Daniel Tan/BoltClock wrote:
>> I don't think that's what he meant.
>>
>> The way I see it, he's asking to apply the style to the submit input if
>> any of the form's descendants have focus. What your rule is doing is
>> applying the style to the form if the submit input has focus.
>>
>
> Ah, right, I somehow missed the description.
> Yes, what he is suggesting is a very common use case and as far as I can
> see, doesn't seem to be addressed in Selectors 4 in any way.

It would be if I removed the "compound selectors only" restriction in
:matches() and :not(), which I'm thinking I should just go ahead and
do since everyone's coming up with use cases for it...

The selector would then be

   form:matches(! > input:focus) input[submit] { display: none; }

~fantasai

Received on Wednesday, 25 January 2012 21:22:11 UTC