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

Re: [selectors4] Why is the :only-child pseudo-class not a special case in terms of specificity?

From: Michiel Bijl <michiel@agosto.nl>
Date: Thu, 23 Jul 2015 11:34:59 +0200
Cc: www-style@w3.org
Message-Id: <F4CB6AD3-566D-4328-9EC9-0979CB809F81@agosto.nl>
To: James Donnelly <jdonnelly30@gmail.com>
This is the same as ‘:hover:hover' having a higher specificity than ‘:hover’; more (pseudo)selectors equals higher specificity, right?

Test case: http://codepen.io/Michiel/pen/452fde8ea665928e2e6fa1edf10ba49b?editors=110

—Michiel

> On 15 Jul 2015, at 07:23, James Donnelly <jdonnelly30@gmail.com> wrote:
> 
> In both the Selectors recommendation and the Selectors4 working draft, the :only-child pseudo-class documentation states:
> 
>  
> > “Same as ‘:first-child:last-child’ or ‘:nth-child(1):nth-last-child(1)’, but with a lower specificity.”
> 
>  
> As much as it would go against the basic specificity implementation, wouldn’t it be logical for the :only-child selector to have the same specificity as those combined selectors?
> 
>  
> - James 
> 


Received on Thursday, 23 July 2015 09:35:47 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 22:52:18 UTC