W3C home > Mailing lists > Public > www-style@w3.org > September 2010

Re: CSS4 Selectors (was Re: Extend use of namespaces)

From: Alexander Shpack <shadowkin@gmail.com>
Date: Wed, 22 Sep 2010 10:24:22 +0300
Message-ID: <AANLkTi=hjWu4XJ8UNepOTMjY5TM1rwzhwgpj6ep8-0Ne@mail.gmail.com>
To: "Tab Atkins Jr." <jackalmage@gmail.com>
Cc: Brad Kemper <brad.kemper@gmail.com>, Aryeh Gregor <Simetrical+w3c@gmail.com>, Boris Zbarsky <bzbarsky@mit.edu>, Anne van Kesteren <annevk@opera.com>, www-style <www-style@w3.org>
On Wed, Sep 22, 2010 at 5:02 AM, Tab Atkins Jr. <jackalmage@gmail.com> wrote:
> On Tue, Sep 21, 2010 at 1:33 PM, Brad Kemper <brad.kemper@gmail.com> wrote:
>> On Sep 21, 2010, at 12:16 PM, Aryeh Gregor <Simetrical+w3c@gmail.com> wrote:
>>> You're already forced to do stuff like this anyway in some cases.  For
>>> instance, if you want to alternate between three styles of bullets for
>>> <ul>,
>>>
>>> ul li { list-style-type: disc }
>>> ul ul li { list-style-type: square }
>>> ul ul ul li { list-style-type: circle }
>>> ul ul ul ul li { list-style-type: disc }
>>> ul ul ul ul ul li { list-style-type: square }
>>> ul ul ul ul ul ul li { list-style-type: circle }
>>> ul ul ul ul ul ul ul li { list-style-type: disc }
>>> ul ul ul ul ul ul ul ul li { list-style-type: square }
>>> ul ul ul ul ul ul ul ul ul li { list-style-type: circle }
>>
>> Maybe we need a 'nth-generation-of-type()' in CSS4 Selectors.
>
> Are there really many cases beyond list-types for this, though?  The
> cycle() function was proposed to solve this issue (though it certainly
> needs some love to solve its issues).
>
> ~TJ
>
>

:cycle(ul ul):nth-child(odd) li { list-style-type: disc }
:cycle(ul ul):nth-child(even) li { list-style-type: square }

Or

ul :cycle(ul):nth-child(odd) li
ul > :cycle(ul):nth-child(odd) li

Like Mathematics's digit repeating 44.945(5)
Received on Wednesday, 22 September 2010 07:48:38 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:20:31 GMT