
Styling HTML elements based on locale - sergeylukin
http://sergeylukin.com/2013/styling-html-elements-based-on-locale/
======
PavlovsCat
> While there most likely isn’t much of need in styling elements based on
> their locale

It might be useful for languages that go right to left, etc. since speakers of
those languages also like their nav elements (and everything, really) in that
order.

~~~
sergeylukin
I would only use :lang pseudo class to style direction-specific
documents/elements if I'd be certain that no other language of same direction
will be added in the future (and I can never be certain in something like
that).

Actually direction-specific styling is a different topic I think and I wish we
had a :dir pseudo class or something for documents with multiple directions.

Usually RTL languages expect the whole layout (with few exceptions) to be in
opposite direction and not just nav elements. So, if a document exists in LTR
and RTL (or even TTB) languages I'd recommend having separate stylesheet for
each direction instead (btw it can be achieved and maintained easily with CSS
pre-processors).

If, however, multiple directions are mixed in one document, I'd probably use
descendant selector instead:

body [dir="rtl"] p {} or body [dir="ttb"] p {} etc.

I have yet to see such combinations however..

------
matchu
Neat! If we didn't have this feature, we could still apply the style to
lang=ca elements and reset it in lang!=ca elements, but this is more readable
and avoids cases in which resetting is nasty.

~~~
sergeylukin
We could, but then we'd need to know specifically what to reset now, and
maintain the resetting styles each time we introduce new language which sounds
like something we'd want to avoid.

