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

Re: CSS pseudo-selector :closest and :further

From: David Rodrigues <david.proweb@gmail.com>
Date: Wed, 18 Mar 2015 17:55:10 +0000
Message-ID: <CAEsg9X1oe2BZXfnk3_Zk+vTuv6dL1LQRE8nnvJ7vz6o6Y-ugmA@mail.gmail.com> (sfid-20150318_175515_926129_AC28B941)
To: Brian Kardell <bkardell@gmail.com>
Cc: "www-style@w3.org" <www-style@w3.org>
It'll allow you match the *closest* element from *base selector*.

A live example (not that I "hacked" it because it not is supported
currently):
http://jsfiddle.net/de1j1su5/

*Possible signatures:*

body:closest(.text)

body .text:closest()

body :closest(.text)



2015-03-18 14:36 GMT-03:00 Brian Kardell <bkardell@gmail.com>:

> On Tue, Mar 17, 2015 at 12:08 PM, David Rodrigues
> <david.proweb@gmail.com> wrote:
> > I don't know if here is the right place, but will be great if create a
> new
> > pseudo-selector definition that allow select closest or further element
> from
> > a base element. For instance:
> >
> I'm pretty sure I don't understand the proposal, but :closest as
> pioneered by jQuery a proposal is already a thing in the complete
> profile https://developer.mozilla.org/en-US/docs/Web/API/Element/closest
> (at least in whatwg and it has implementations and polyfills), you
> might want to look at that and avoid overloading the meaning.
>
>
>
>
>
> --
> Brian Kardell :: @briankardell :: hitchjs.com
>



-- 
David S. Rodrigues
Received on Thursday, 19 March 2015 17:55:49 UTC

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