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

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 UTC