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

Re: [css3-lists] Proposal for a generic numeric list-style-type

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Tue, 18 May 2010 09:00:31 -0700
Message-ID: <AANLkTikQnHFw-lXsIBgO6hR5xck3guCSemTPYkDnbxC7@mail.gmail.com>
To: Markus Ernst <derernst@gmx.ch>
Cc: timeless <timeless@gmail.com>, Simetrical+w3c@gmail.com, www-style@w3.org, gabriele.romanato@gmail.com
On Tue, May 18, 2010 at 1:55 AM, Markus Ernst <derernst@gmx.ch> wrote:
> To achieve this with the current CSS3 spec I need to specify the list-style-type value separately for all languages used. Even more, I need to know the exact HTML structure when writing the CSS, as language attributes can occur in any of the parent elements of the list. So, from an author's POV a generic numeric value seems highly desirable to me.

You don't have to know anything about the structure of the document,
or the locations of the actual @lang attributes.  The :lang
pseudoclass operates on the language of the element, which "inherits"
from its ancestors.  Check out the example in Selectors:

"""
Note the difference between [lang|=xx] and :lang(xx). In this HTML
example, only the BODY matches [lang|=fr] (because it has a LANG
attribute) but both the BODY and the P match :lang(fr) (because both
are in French).

<body lang=fr>
  <p>Je suis Fran├žais.</p>
</body>
"""

So, if you really wanted to internationalize your list markers, just
put in a handful of rules in your global CSS for every language you
support:

ol:lang(zh) { list-style-type: ...}
ol:lang(uk) {...}
ol:lang(he) {...}

~TJ
Received on Tuesday, 18 May 2010 16:08:56 GMT

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