-
Notifications
You must be signed in to change notification settings - Fork 206
[BpkStylesheets] Add locale-specific font-family overrides for non-Latin languages #4343
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
db49a0f
4cc9650
6f1ba15
1cbe847
fa7a4b6
898922b
7a58fad
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -426,6 +426,10 @@ $bpk-fonts: ( | |
| } | ||
| } | ||
|
|
||
| // Language-specific font stacks applied to any element whose `lang` matches | ||
| // the given locale. Each stack prefers the locale's primary Noto Sans face, | ||
| // then related CJK and other non-Latin Noto families as fallbacks, then system fonts. | ||
|
|
||
| [lang='ja-JP'], | ||
| :lang(ja-JP) { | ||
| --bpk-base-font-stack: | ||
|
|
@@ -437,7 +441,9 @@ $bpk-fonts: ( | |
| } | ||
|
|
||
| [lang='zh-TW'], | ||
| :lang(zh-TW) { | ||
| :lang(zh-TW), | ||
| [lang='zh-HK'], | ||
| :lang(zh-HK) { | ||
| --bpk-base-font-stack: | ||
| 'Skyscanner Relative', 'Noto Sans TC', 'Noto Sans SC', 'Noto Sans JP', | ||
| 'Noto Sans KR', 'Noto Sans Arabic', 'Noto Sans Hebrew', 'Noto Sans', | ||
|
|
@@ -446,6 +452,79 @@ $bpk-fonts: ( | |
| 'Helvetica Neue', sans-serif; | ||
| } | ||
|
|
||
| [lang='zh-CN'], | ||
| :lang(zh-CN) { | ||
| --bpk-base-font-stack: | ||
| 'Skyscanner Relative', 'Noto Sans SC', 'Noto Sans TC', 'Noto Sans JP', | ||
| 'Noto Sans KR', 'Noto Sans Arabic', 'Noto Sans Hebrew', 'Noto Sans', | ||
| 'Noto Sans Devanagari', 'Noto Sans Thai', -apple-system, blinkmacsystemfont, | ||
| roboto, oxygen, ubuntu, cantarell, 'Fira Sans', 'Droid Sans', | ||
| 'Helvetica Neue', sans-serif; | ||
| } | ||
|
|
||
| [lang='ko-KR'], | ||
| :lang(ko-KR) { | ||
| --bpk-base-font-stack: | ||
| 'Skyscanner Relative', 'Noto Sans KR', 'Noto Sans JP', 'Noto Sans SC', | ||
| 'Noto Sans TC', 'Noto Sans Arabic', 'Noto Sans Hebrew', 'Noto Sans', | ||
| 'Noto Sans Devanagari', 'Noto Sans Thai', -apple-system, blinkmacsystemfont, | ||
| roboto, oxygen, ubuntu, cantarell, 'Fira Sans', 'Droid Sans', | ||
| 'Helvetica Neue', sans-serif; | ||
| } | ||
|
|
||
| [lang='th-TH'], | ||
| :lang(th-TH) { | ||
| --bpk-base-font-stack: | ||
| 'Skyscanner Relative', 'Noto Sans Thai', 'Noto Sans Arabic', | ||
| 'Noto Sans Hebrew', 'Noto Sans', 'Noto Sans Devanagari', -apple-system, | ||
| blinkmacsystemfont, roboto, oxygen, ubuntu, cantarell, 'Fira Sans', | ||
| 'Droid Sans', 'Helvetica Neue', sans-serif; | ||
| } | ||
|
|
||
| [lang='hi-IN'], | ||
| :lang(hi-IN) { | ||
| --bpk-base-font-stack: | ||
| 'Skyscanner Relative', 'Noto Sans Devanagari', 'Noto Sans Arabic', | ||
| 'Noto Sans Hebrew', 'Noto Sans', 'Noto Sans Thai', -apple-system, | ||
| blinkmacsystemfont, roboto, oxygen, ubuntu, cantarell, 'Fira Sans', | ||
| 'Droid Sans', 'Helvetica Neue', sans-serif; | ||
| } | ||
|
|
||
| [lang='ar'], | ||
| :lang(ar) { | ||
| --bpk-base-font-stack: | ||
| 'Skyscanner Relative', 'Noto Sans Arabic', 'Noto Sans Hebrew', 'Noto Sans', | ||
| 'Noto Sans Devanagari', 'Noto Sans Thai', -apple-system, blinkmacsystemfont, | ||
| roboto, oxygen, ubuntu, cantarell, 'Fira Sans', 'Droid Sans', | ||
| 'Helvetica Neue', sans-serif; | ||
| } | ||
|
|
||
| [lang='he'], | ||
| :lang(he) { | ||
| --bpk-base-font-stack: | ||
| 'Skyscanner Relative', 'Noto Sans Hebrew', 'Noto Sans Arabic', 'Noto Sans', | ||
| 'Noto Sans Devanagari', 'Noto Sans Thai', -apple-system, blinkmacsystemfont, | ||
| roboto, oxygen, ubuntu, cantarell, 'Fira Sans', 'Droid Sans', | ||
| 'Helvetica Neue', sans-serif; | ||
| } | ||
|
|
||
| [lang='el-GR'], | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. seems all font setting of |
||
| :lang(el-GR), | ||
| [lang='ru-RU'], | ||
| :lang(ru-RU), | ||
| [lang='uk-UA'], | ||
| :lang(uk-UA), | ||
| [lang='bg-BG'], | ||
| :lang(bg-BG), | ||
| [lang='vi-VN'], | ||
| :lang(vi-VN) { | ||
| --bpk-base-font-stack: | ||
| 'Skyscanner Relative', 'Noto Sans', 'Noto Sans Arabic', 'Noto Sans Hebrew', | ||
| 'Noto Sans Devanagari', 'Noto Sans Thai', -apple-system, blinkmacsystemfont, | ||
| roboto, oxygen, ubuntu, cantarell, 'Fira Sans', 'Droid Sans', | ||
| 'Helvetica Neue', sans-serif; | ||
| } | ||
|
|
||
| // Using :where([lang]) ensures that we trigger a re-evaluation of the font-stack | ||
| // variable for any element with a lang attribute, but with ZERO specificity. | ||
| // This means any component with its own class (like BpkBubble or Editorial text) | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.