aboutsummaryrefslogtreecommitdiff
path: root/src/lib/ListItemWithIcon.svelte
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/ListItemWithIcon.svelte')
-rw-r--r--src/lib/ListItemWithIcon.svelte9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/lib/ListItemWithIcon.svelte b/src/lib/ListItemWithIcon.svelte
index 2c7aade..7666c18 100644
--- a/src/lib/ListItemWithIcon.svelte
+++ b/src/lib/ListItemWithIcon.svelte
@@ -1,8 +1,10 @@
<script lang="ts">
export let url: string
+ export let alt: string | undefined = undefined
</script>
-<li class="list-item-with-icon" style="background: url({url}) 0 0/1em no-repeat">
+<li class="list-item-with-icon">
+ <img class="list-item-icon" src={url} {alt} loading="lazy" />
<slot />
</li>
@@ -12,7 +14,12 @@
padding-left: 1.2em;
position: relative;
right: 1.2em;
+ }
+ .list-item-icon {
image-rendering: crisp-edges;
image-rendering: pixelated;
+ height: 1em;
+ position: absolute;
+ margin-left: -1.2em;
}
</style>