]> git.ardis.lu - css-for-line-clamp-ellipsis/commitdiff
Preload fonts
authorArdis Lu <ardisglu@gmail.com>
Thu, 14 Dec 2023 06:57:41 +0000 (22:57 -0800)
committerArdis Lu <ardisglu@gmail.com>
Thu, 14 Dec 2023 06:57:41 +0000 (22:57 -0800)
Reduces network waterfall clusters from 2 to 1. Type hint removed since WOFF2 is supported on all modern web browsers.

index.html

index b90a0cd6f98bc16fc30306196f856ec519a423ca..c7f283c55dda493d49826903ce3c37252f835879 100644 (file)
@@ -11,6 +11,9 @@
   <meta property="og:url" content="https://cssforlineclampellipsis.com/">
   <link rel="canonical" href="https://cssforlineclampellipsis.com/">
   <link rel="icon" href="data:,">
+  <link rel="preload" href="/Inter.woff2" as="font" crossorigin>
+  <link rel="preload" href="/Inter_Bold.woff2" as="font" crossorigin>
+  <link rel="preload" href="/Source_Code_Pro.woff2" as="font" crossorigin>
   <title>CSS for line clamp ellipsis</title>
   <style>
     @import '/prism.css' layer;
     @font-face {
       font-family: 'Inter';
       font-weight: 400;
-      src: local('Inter'), url('/Inter.woff2') format('woff2');
+      src: local('Inter'), url('/Inter.woff2');
     }
 
     @font-face {
       font-family: 'Inter';
       font-weight: 700;
-      src: local('Inter'), url('/Inter_Bold.woff2') format('woff2');
+      src: local('Inter'), url('/Inter_Bold.woff2');
     }
 
     @font-face {
       font-family: 'Source Code Pro';
-      src: local('Source Code Pro'), url('/Source_Code_Pro.woff2') format('woff2');
+      src: local('Source Code Pro'), url('/Source_Code_Pro.woff2');
     }
 
     :root {
This page took 0.039506 seconds and 4 git commands to generate.