Skip to content

Commit

Permalink
Load Inter CSS directly (matrix-org#1444)
Browse files Browse the repository at this point in the history
Move the load of the Inter font CSS from _variables_project.scss to head-end.html.

Empirically, this seems to fix matrix-org#965
  • Loading branch information
richvdh authored and clokep committed May 3, 2023
1 parent 9b4c736 commit 334970b
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 6 deletions.
12 changes: 6 additions & 6 deletions assets/scss/_variables_project.scss
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,12 @@ $table-row-default: $secondary-lighter-background;
$td-enable-google-fonts: false;

/*
* Replace the default font with Inter - we load it from a local copy, which is downloaded from
* Google Fonts manually via a script:
* https://github.com/matrix-org/matrix-spec/tree/main/static/css/fonts
* Replace the default font with Inter.
*
* The $font-family-sans-serif definition here overrides the default value set by docsy:
* https://github.com/matrix-org/docsy/blob/66a4e61d2d34edc7196b9df83a7d09cd4af14b47/assets/scss/_variables.scss#L68
* and adds "Inter" to the front. */
@import url("../css/fonts/Inter.css");
$font-family-sans-serif: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
* and adds "Inter" to the front.
*
* The font itself is loaded via stylesheet link layouts/partials/hooks/head-end.html.
*/
$font-family-sans-serif: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
1 change: 1 addition & 0 deletions changelogs/internal/newsfragments/1444.clarification
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Update references to Inter font.
10 changes: 10 additions & 0 deletions layouts/partials/hooks/head-end.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,16 @@

*/}}

{{/*
Load the Inter font.

We load it from a local copy, which is downloaded from
Google Fonts manually via a script:
https://github.com/matrix-org/matrix-spec/tree/main/static/css/fonts
*/}}
<link rel="preload" href="{{ "/css/fonts/Inter.css" | relURL }}" as="style">
<link rel="stylesheet" href="{{ "/css/fonts/Inter.css" | relURL }}">

{{ $scss := "scss/custom.scss"}}
{{ if .Site.IsServer }}
{{/* Note the missing postCSS. This makes it snappier to develop in Chrome, but makes it look sub-optimal in other browsers. */}}
Expand Down

0 comments on commit 334970b

Please sign in to comment.