]> git.ardis.lu - ardislu.dev/commitdiff
Inline svg width and height
authorArdis Lu <ardisglu@gmail.com>
Thu, 3 Mar 2022 06:09:45 +0000 (22:09 -0800)
committerArdis Lu <ardisglu@gmail.com>
Thu, 3 Mar 2022 06:09:45 +0000 (22:09 -0800)
Reduces CLS when CSS fails or is slow to load

index.html
style.css

index a0417dcd3d85b465313b42643b93aae91aaedd19..adb72a113b43e6a4b960f334b961fcfc258252b2 100644 (file)
@@ -22,7 +22,7 @@
     <header>
       <h1>ardislu.dev</h1>
       <a href="https://github.com/ardislu/ardislu.dev">
-        <svg role="img" aria-labelledby="github">
+        <svg role="img" aria-labelledby="github" width="24" height="24" viewBox="0 0 24 24">
           <title id="github">GitHub repository</title>
           <path d="M12 2A10 10 0 0 0 2 12c0 4.42 2.87 8.17 6.84 9.5c.5.08.66-.23.66-.5v-1.69c-2.77.6-3.36-1.34-3.36-1.34c-.46-1.16-1.11-1.47-1.11-1.47c-.91-.62.07-.6.07-.6c1 .07 1.53 1.03 1.53 1.03c.87 1.52 2.34 1.07 2.91.83c.09-.65.35-1.09.63-1.34c-2.22-.25-4.55-1.11-4.55-4.92c0-1.11.38-2 1.03-2.71c-.1-.25-.45-1.29.1-2.64c0 0 .84-.27 2.75 1.02c.79-.22 1.65-.33 2.5-.33c.85 0 1.71.11 2.5.33c1.91-1.29 2.75-1.02 2.75-1.02c.55 1.35.2 2.39.1 2.64c.65.71 1.03 1.6 1.03 2.71c0 3.82-2.34 4.66-4.57 4.91c.36.31.69.92.69 1.85V21c0 .27.16.59.67.5C19.14 20.16 22 16.42 22 12A10 10 0 0 0 12 2z" />
         </svg>
   <template id="post-header">
     <header class="post-header">
       <a href="/">
-        <svg role="img" aria-labelledby="home">
+        <svg role="img" aria-labelledby="home" width="24" height="24" viewBox="0 0 24 24">
           <title id="home">Home</title>
           <path d="M0 0h24v24H0z" fill="none" />
           <path d="M10 20v-6h4v6h5v-8h3L12 3 2 12h3v8z" />
         </svg>
       </a>
       <a id="edit" href="/">
-        <svg role="img" aria-labelledby="pencil">
+        <svg role="img" aria-labelledby="pencil" width="24" height="24" viewBox="0 0 24 24">
           <title id="pencil">Edit this article</title>
           <path d="M0 0h24v24H0V0z" fill="none" />
           <path d="M14.06 9.02l.92.92L5.92 19H5v-.92l9.06-9.06M17.66 3c-.25 0-.51.1-.7.29l-1.83 1.83 3.75 3.75 1.83-1.83c.39-.39.39-1.02 0-1.41l-2.34-2.34c-.2-.2-.45-.29-.71-.29zm-3.6 3.19L3 17.25V21h3.75L17.81 9.94l-3.75-3.75z" />
index 7316abf170f222ebfb036fe03000707a59ddd901..36a507529cf7d7817b8678c3b34e4aa9aca7c92b 100644 (file)
--- a/style.css
+++ b/style.css
@@ -34,11 +34,6 @@ a:hover, a:focus {
   text-decoration: underline;
 }
 
-svg {
-  width: 24px;
-  height: 24px;
-}
-
 kbd {
   background: linear-gradient(180deg, hsl(0deg 0% 86%), hsl(0deg 0% 94%));
   font-family: Menlo, Consolas, Monaco, Liberation Mono, Lucida Console, monospace;
This page took 0.035392 seconds and 4 git commands to generate.