Cédric Krier pushed to branch branch/default at Tryton / Website
Commits:
646a13ef by Cédric Krier at 2023-03-02T13:42:35+01:00
Use font swapping and push only regular font
This provides a good trade-off between rendering and font download.
- - - - -
2 changed files:
- app.py
- sass/_font.scss
Changes:
=====================================
app.py
=====================================
@@ -175,11 +175,7 @@
'static', {'filename': 'css/main.css'}, {
'rel': 'preload', 'as': 'style', 'nopush': True}),
LinkHeader(
- 'static', {'filename': 'fonts/RobotoCondensed-Light.woff'}, {
- 'rel': 'preload', 'as': 'font', 'nopush': True,
- 'crossorigin': True}),
- LinkHeader(
'static', {'filename': 'fonts/RobotoCondensed-Regular.woff'}, {
'rel': 'preload', 'as': 'font', 'nopush': True,
'crossorigin': True}),
LinkHeader(
@@ -182,11 +178,7 @@
'static', {'filename': 'fonts/RobotoCondensed-Regular.woff'}, {
'rel': 'preload', 'as': 'font', 'nopush': True,
'crossorigin': True}),
LinkHeader(
- 'static', {'filename': 'fonts/RobotoCondensed-Bold.woff'}, {
- 'rel': 'preload', 'as': 'font', 'nopush': True,
- 'crossorigin': True}),
- LinkHeader(
'static', {'filename': 'fonts/material-icons.woff2'}, {
'rel': 'preload', 'as': 'font', 'nopush': True,
'crossorigin': True}),
=====================================
sass/_font.scss
=====================================
@@ -1,5 +1,5 @@
@font-face {
- font-display: optional;
+ font-display: swap;
font-family: 'Roboto Condensed';
font-style: normal;
font-weight: 300;
@@ -11,7 +11,7 @@
}
@font-face {
- font-display: optional;
+ font-display: swap;
font-family: 'Roboto Condensed';
font-style: normal;
font-weight: 400;
@@ -23,7 +23,7 @@
}
@font-face {
- font-display: optional;
+ font-display: swap;
font-family: 'Roboto Condensed';
font-style: normal;
font-weight: 700;
View it on Heptapod:
https://foss.heptapod.net/tryton/website/-/commit/646a13efd3b1f6a9ef5b1fb157d46e3f8a63597b
--
View it on Heptapod:
https://foss.heptapod.net/tryton/website/-/commit/646a13efd3b1f6a9ef5b1fb157d46e3f8a63597b
You're receiving this email because of your account on foss.heptapod.net.