mirror of
https://github.com/pheralb/svgl.git
synced 2025-02-06 15:17:58 +08:00
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:
commit
e814a3c7ec
@ -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 -->
|
||||||
|
Loading…
x
Reference in New Issue
Block a user