Merge pull request #225 from ivanosquis10/fixing-performance-errors-svgs

📦 Added height and width properties for img tags containing svgs
This commit is contained in:
Pablo Hdez 2024-01-24 11:50:21 +00:00 committed by GitHub
commit e814a3c7ec
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -146,6 +146,10 @@
// Icon Stroke & Size: // Icon Stroke & Size:
let iconStroke = 1.8; let iconStroke = 1.8;
let iconSize = 16; let iconSize = 16;
// Width & Height of <img>:
const width = 40;
const height = 40;
</script> </script>
<CardSpotlight> <CardSpotlight>
@ -160,6 +164,8 @@
alt={svgInfo.title} alt={svgInfo.title}
title={svgInfo.title} title={svgInfo.title}
loading="lazy" loading="lazy"
{width}
{height}
/> />
<img <img
class="block dark:hidden mb-4 mt-2 h-10" class="block dark:hidden mb-4 mt-2 h-10"
@ -169,6 +175,8 @@
alt={svgInfo.title} alt={svgInfo.title}
title={svgInfo.title} title={svgInfo.title}
loading="lazy" loading="lazy"
{width}
{height}
/> />
{:else} {:else}
<img <img
@ -177,6 +185,8 @@
alt={svgInfo.title} alt={svgInfo.title}
title={svgInfo.title} title={svgInfo.title}
loading="lazy" loading="lazy"
{width}
{height}
/> />
<img <img
class="block dark:hidden mb-4 mt-2 h-10" class="block dark:hidden mb-4 mt-2 h-10"
@ -184,6 +194,8 @@
alt={svgInfo.title} alt={svgInfo.title}
title={svgInfo.title} title={svgInfo.title}
loading="lazy" loading="lazy"
{width}
{height}
/> />
{/if} {/if}
<!-- Title --> <!-- Title -->