From a9e9202e898c347cc149dbc5dafb81893e68153d Mon Sep 17 00:00:00 2001 From: Richard van der Hoff <1389908+richvdh@users.noreply.github.com> Date: Tue, 28 Feb 2023 14:56:19 +0000 Subject: [PATCH] Load Inter CSS directly (#1444) Move the load of the Inter font CSS from _variables_project.scss to head-end.html. Empirically, this seems to fix #965 --- assets/scss/_variables_project.scss | 12 ++++++------ changelogs/internal/newsfragments/1444.clarification | 1 + layouts/partials/hooks/head-end.html | 10 ++++++++++ 3 files changed, 17 insertions(+), 6 deletions(-) create mode 100644 changelogs/internal/newsfragments/1444.clarification diff --git a/assets/scss/_variables_project.scss b/assets/scss/_variables_project.scss index 9b4a0b15..8ff5fe98 100644 --- a/assets/scss/_variables_project.scss +++ b/assets/scss/_variables_project.scss @@ -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"; \ No newline at end of file + * 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"; diff --git a/changelogs/internal/newsfragments/1444.clarification b/changelogs/internal/newsfragments/1444.clarification new file mode 100644 index 00000000..1bbaa905 --- /dev/null +++ b/changelogs/internal/newsfragments/1444.clarification @@ -0,0 +1 @@ +Update references to Inter font. diff --git a/layouts/partials/hooks/head-end.html b/layouts/partials/hooks/head-end.html index 925c43cc..7bceff45 100644 --- a/layouts/partials/hooks/head-end.html +++ b/layouts/partials/hooks/head-end.html @@ -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 +*/}} + + + {{ $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. */}}