Skip to content

Commit

Permalink
fix(styles, internet-header): Replaced system-ui fallback font with l…
Browse files Browse the repository at this point in the history
…ist of fonts (#2735)

The list is based on:

- https://phabricator.wikimedia.org/T175877
- https://github.com/twbs/bootstrap/pull/22377/files

Also I've tested "Segoe UI" with "Frutiger Neue For Post" and it works
quite good as a fallback font without any changes:
https://meowni.ca/font-style-matcher/
  • Loading branch information
imagoiq authored Mar 6, 2024
1 parent 41fcd50 commit 441255f
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 2 deletions.
6 changes: 6 additions & 0 deletions .changeset/purple-clocks-call.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@swisspost/internet-header': patch
'@swisspost/design-system-styles': patch
---

Replaced `system-ui` fallback font with a list of fallbacks to avoid rendering issues with specific writing system (chinese, arabic…).
3 changes: 2 additions & 1 deletion packages/internet-header/src/styles.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
@use '@swisspost/design-system-styles/basics';
@use '@swisspost/design-system-styles/variables/type';

body,
h1,
Expand All @@ -7,7 +8,7 @@ h3,
h4,
h5,
h6 {
font-family: 'Frutiger Neue for Post', system-ui, sans-serif !important;
font-family: type.$font-family-sans-serif !important;
}

// For imported auto-generated readme files into .mdx documentations
Expand Down
10 changes: 9 additions & 1 deletion packages/styles/src/variables/_type.scss
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,15 @@
//
// Font, line-height, and color for body text, headings, and more.

$font-family-sans-serif: 'Frutiger Neue For Post', system-ui, sans-serif !default;
$font-family-sans-serif:
'Frutiger Neue For Post',
-apple-system,
BlinkMacSystemFont,
'Segoe UI',
Roboto,
'Helvetica Neue',
Arial,
sans-serif !default;
$font-family-monospace: SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New',
monospace !default;
$font-family-base: $font-family-sans-serif !default;
Expand Down

0 comments on commit 441255f

Please sign in to comment.