W3C home > Mailing lists > Public > www-style@w3.org > June 2014

[css-variables][i18n] :lang() Example

From: Christoph Päper <christoph.paeper@crissov.de>
Date: Tue, 17 Jun 2014 13:44:13 +0200
Message-Id: <D579185E-CDEC-44DB-A8AD-F75321AD1371@crissov.de>
To: www-style list <www-style@w3.org>
I believe the spec of the Custom Properties for Cascading Variables module would benefit from an example that showed how to use variables for internationalization, e.g.

  :root, /* default */
  :root:lang(en) {--external-link: "external link";}
  :root:lang(de) {--external-link: "externer Link";}

  a[href^="http"]::after {content: " (" var(--external-link) ")"}

Features and values from GCPM etc. are more powerful if used this way.
Received on Tuesday, 17 June 2014 11:44:43 UTC

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:39:22 UTC