Skip to content

Commit

Permalink
Improve font rendering on Linux (#1529)
Browse files Browse the repository at this point in the history
* Improve $body-font stack

This is an attempt at fixing #1209. Further reading: 

- https://infinnie.github.io/blog/2017/systemui.html
- https://blog.jim-nielsen.com/2020/system-fonts-on-the-web/

* pause stylelint complaints in documented stack

* Create silent-geckos-do.md

Co-authored-by: simurai <simurai@github.com>
  • Loading branch information
vdepizzol and simurai committed Aug 12, 2021
1 parent befd4ba commit dca8e0a
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/silent-geckos-do.md
@@ -0,0 +1,5 @@
---
"@primer/css": minor
---

Improve font rendering on Linux
24 changes: 23 additions & 1 deletion src/support/variables/typography.scss
Expand Up @@ -32,7 +32,29 @@ $lh-condensed: 1.25 !default;
$lh-default: 1.5 !default;

// Font stacks
$body-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji" !default;
// stylelint-disable no-eol-whitespace
$body-font:
// Apple OSs
-apple-system,
BlinkMacSystemFont,

// Windows
// Note this should be prioritized over `system-ui` to avoid legacy fonts.
// See https://infinnie.github.io/blog/2017/systemui.html
"Segoe UI Variable",
"Segoe UI",

// Linux-friendly system-level fonts + fallbacks
system-ui,
ui-sans-serif,
Helvetica,
Arial,
sans-serif,

// Emojis
"Apple Color Emoji",
"Segoe UI Emoji" !default;
// stylelint-enable no-eol-whitespace

// Monospace font stack
// Note: SFMono-Regular needs to come before SF Mono to fix an older version of the font in Chrome
Expand Down

0 comments on commit dca8e0a

Please sign in to comment.