Skip to content

Commit 69aef05

Browse files
authored
Add support for localized font families (#677)
Resolves: rdar://108129110
1 parent 0f1dfd8 commit 69aef05

File tree

3 files changed

+25
-0
lines changed

3 files changed

+25
-0
lines changed

src/styles/base/_typography.scss

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,14 @@ html {
1818
@include inTargetWeb {
1919
font: var(--typography-html-font, $body-font-size $font-content);
2020
}
21+
/// The quotes CSS property sets how the browser should render quotation marks
22+
/// added through a CSS content field or the HTML q element
2123
quotes: "" "";
24+
@each $lang, $quotes in $localizedQuotes {
25+
&:lang(#{$lang}) {
26+
quotes: $quotes;
27+
}
28+
}
2229
}
2330

2431
body {

src/styles/core/_vars.scss

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,3 +81,11 @@ $on-this-page-aside-width: 192px;
8181

8282
// Suggest Lang
8383
$suggest-lang-height: 52px;
84+
85+
// Localized Quotes
86+
$localizedQuotes: (
87+
ja-JP: "" "",
88+
) !default;
89+
90+
// Localized Fonts
91+
$localizedFonts: () !default;

src/styles/core/typography/_font-style-utils.scss

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,16 @@ $font-weight-bold: 700 !default;
6060
} @else {
6161
@warn 'The font style `#{$font-style-name}` is not defined.';
6262
}
63+
//
64+
// Add support for localized font families
65+
//
66+
@if ($localizedFonts) {
67+
@each $lang, $fonts in $localizedFonts {
68+
:lang(#{$lang}) & {
69+
font-family: $fonts;
70+
}
71+
}
72+
}
6373
}
6474

6575
//

0 commit comments

Comments
 (0)