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

Re: [selectors] Previous-sibling combinator?

From: Marat Tanalin <mtanalin@yandex.ru>
Date: Wed, 04 Feb 2015 16:19:03 +0300
To: Tab Atkins Jr. <jackalmage@gmail.com>, Henrik Andersson <henke@henke37.cjb.net>
Cc: Clive Chan <doobahead@gmail.com>, www-style list <www-style@w3.org>
Message-Id: <28746951423055943@web12j.yandex.ru>
04.02.2015, 07:21, "Tab Atkins Jr." <jackalmage@gmail.com>:
> Dash has significant parsing complications - dashes tend to get
> absorbed into nearby identifiers.

/* I was sure that this is a reply to my question in my thread asked 5 days ago [1]. */

As for exact form of combinator -- be it a dash or another combinator, it is actually a very minor thing -- the idea is the same anyway.

I believe that making whitespace around dash as a combinator required would be enough while not confusing at all (I literally don't understand why some people don't put whitespace around ALL atomic selectors ALWAYS -- how can they read that mess?).

BUT if dash is any problematic, we could easily use a combination of two characters or a pseudoclass or just a literal colon. For example, instead of originally proposed by me 3 years ago [2]:

    P - UL {
        /* Styles for UL element which is
           previous sibling of P element. */

we could use this:

    P <- UL {}

or this:

    P :prev UL {}

or just this:

    P : UL {}

So we need just to choose a best of these options and go on.

So what are our next steps to actually add the previous-sibling combinator to the selectors spec and ensure that your conclusion [3] will not be lost and forgotten?


[1] https://lists.w3.org/Archives/Public/www-style/2015Jan/0610.html
[2] https://lists.w3.org/Archives/Public/www-style/2012Jan/1245.html
[3] https://lists.w3.org/Archives/Public/www-style/2015Jan/0583.html
Received on Wednesday, 4 February 2015 13:26:05 UTC

This archive was generated by hypermail 2.4.0 : Friday, 25 March 2022 10:08:51 UTC