-
Notifications
You must be signed in to change notification settings - Fork 756
Closed
Labels
Closed as Question AnsweredUsed when the issue is more of a question than a problem, and it's been answered.Used when the issue is more of a question than a problem, and it's been answered.Commenter SatisfiedCommenter has indicated satisfaction with the resolution / edits.Commenter has indicated satisfaction with the resolution / edits.css-variables-1Current WorkCurrent Workeditoriali18n-needs-resolutionIssue the Internationalization Group has raised and looks for a response on.Issue the Internationalization Group has raised and looks for a response on.
Description
(See Example 5)
https://www.w3.org/TR/css-variables-1/#defining-variables
A real-world example of custom property usage is easily separating out strings from where they’re used, to aid in maintenance of internationalization:
:root,
:root:lang(en) {--external-link: "external link";}
:root:lang(de) {--external-link: "externer Link";}
a[href^="http"]::after {content: " (" var(--external-link) ")"}
The variable declarations can even be kept in a separate file, to make maintaining the translations simpler.
The example used the :root to get at the language of the document rather than the contextual :lang value. We (I18N) don't understand why that would be desired?
abbasnaqdi
Metadata
Metadata
Assignees
Labels
Closed as Question AnsweredUsed when the issue is more of a question than a problem, and it's been answered.Used when the issue is more of a question than a problem, and it's been answered.Commenter SatisfiedCommenter has indicated satisfaction with the resolution / edits.Commenter has indicated satisfaction with the resolution / edits.css-variables-1Current WorkCurrent Workeditoriali18n-needs-resolutionIssue the Internationalization Group has raised and looks for a response on.Issue the Internationalization Group has raised and looks for a response on.