فهرست منبع

fix font loading

tuanchris 3 ماه پیش
والد
کامیت
bc36faefbb
2فایلهای تغییر یافته به همراه5 افزوده شده و 2 حذف شده
  1. 2 2
      static/css/material-icons.css
  2. 3 0
      templates/base.html

+ 2 - 2
static/css/material-icons.css

@@ -6,7 +6,7 @@
   font-weight: 400;
   src: url('/static/fonts/material-icons/MaterialIcons-Regular.woff2') format('woff2'),
        url('/static/fonts/material-icons/MaterialIcons-Regular.woff') format('woff');
-  font-display: swap;
+  font-display: block;
 }
 
 @font-face {
@@ -15,7 +15,7 @@
   font-weight: 400;
   src: url('/static/fonts/material-icons/MaterialIconsOutlined-Regular.woff2') format('woff2'),
        url('/static/fonts/material-icons/MaterialIconsOutlined-Regular.woff') format('woff');
-  font-display: swap;
+  font-display: block;
 }
 
 .material-icons {

+ 3 - 0
templates/base.html

@@ -18,6 +18,9 @@
       onload="this.rel='stylesheet'"
       rel="stylesheet"
     />
+    <!-- Preload Material Icons fonts for faster loading -->
+    <link rel="preload" href="/static/fonts/material-icons/MaterialIcons-Regular.woff2" as="font" type="font/woff2" crossorigin>
+    <link rel="preload" href="/static/fonts/material-icons/MaterialIconsOutlined-Regular.woff2" as="font" type="font/woff2" crossorigin>
     <title>{% block title %}{{ app_name or 'Dune Weaver' }}{% endblock %}</title>
     <link rel="apple-touch-icon" sizes="180x180" href="/static/apple-touch-icon.png">
     <link rel="icon" type="image/png" sizes="32x32" href="/static/favicon-32x32.png">