[IMP] website: add swap parameter to fonts import URL
Google fonts now support custom font displaying, which allow us to swap the font when it is loaded. Especially useful for high latency connections. Ref: https://addyosmani.com/blog/google-fonts-font-display/ task-2069043 closes odoo/odoo#36696 Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
@each $url in $o-theme-font-urls {
|
||||
@if $url {
|
||||
@import url("https://fonts.googleapis.com/css?family=#{unquote($url)}");
|
||||
@import url("https://fonts.googleapis.com/css?family=#{unquote($url)}&display=swap");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ $-font-numbers: (
|
||||
$-seen: append($-seen, $-number);
|
||||
$-theme-font: nth($o-theme-font-urls, $-number);
|
||||
@if $-theme-font {
|
||||
@import url("https://fonts.googleapis.com/css?family=#{unquote($-theme-font)}");
|
||||
@import url("https://fonts.googleapis.com/css?family=#{unquote($-theme-font)}&display=swap");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user