diff --git a/src/pages/blog/optimizeing-shopify-theme-2.mdx b/src/pages/blog/optimizeing-shopify-theme-2.mdx index 8485e6f..e91e0b8 100644 --- a/src/pages/blog/optimizeing-shopify-theme-2.mdx +++ b/src/pages/blog/optimizeing-shopify-theme-2.mdx @@ -162,10 +162,82 @@ we will go back to not removing the modernizr file. #### Images Optimization and Elements with Layout Shifts By looking at the -[Web Vitals Webpage Test Report](https://www.webpagetest.org/vitals.php?test=220819_BiDc6R_B5K&run=3#lcp-full) +[Web Vitals Webpage Test Report](https://www.webpagetest.org/vitals.php?test=220819_BiDc6R_B5K&run=3#cls) we can see diferent elements that produce layout shifts. The main one is the -announcement bar. Lets add a fix height to the announcement bar to fix that. +announcement bar. Lets add a fix height to the announcement bar to fix that +issue. As well the main logo appears from no where and moves the size of the header. We can add an aspect ratio property to the logo to fix that by adding `aspect-ratio: 10/3;` to the logo style tag. + +Something we noted in the code was that all the images of the theme have lazy +loading added, even the initially rendered ones. We removed all the lazuy +loading added to the initial images. as well we added a `srcset` attribute and a +`sizes` attribute to the images and even some images where still rendered with +the CSS `background-image` property, we changed that to be an `img` tag. + +This is the code to render the images of the slider before the changes: + +```html + + +
+``` + +After we changed the code it looked like this: + +```html +