Skip to content

Commit

Permalink
Use object-fit: cover for autofilled article previews
Browse files Browse the repository at this point in the history
  • Loading branch information
NikolaGanchev committed Sep 26, 2023
1 parent e408884 commit 58eeaf0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
8 changes: 2 additions & 6 deletions src/lib/ArticlePreview.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@

<div class="container">
{#if preview.postImage}
<img class="preview-image" loading="lazy" src="{env.PUBLIC_SERVER_URL + preview.postImage.url}" alt="{preview.postImage.alt}"/>
<img class="preview-image" loading="lazy" src="{env.PUBLIC_SERVER_URL + preview.postImage.url}" alt="{preview.postImage.alt}">
{:else}
<img class="preview-image logo" loading="lazy" src="{env.PUBLIC_SERVER_URL + $seoAutofillImage.url}" alt="{$seoAutofillImage.alt}">
<img class="preview-image" loading="lazy" src="{env.PUBLIC_SERVER_URL + $seoAutofillImage.url}" alt="{$seoAutofillImage.alt}">
{/if}
<div class="content">
<div class="text">
Expand All @@ -37,10 +37,6 @@
width: 100%;
}
.preview-image.logo {
object-fit: contain;
}
.content {
display: flex;
padding: 1rem;
Expand Down
1 change: 0 additions & 1 deletion src/lib/BigArticlePreview.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@
}
.preview-image.logo {
object-fit: contain;
background-color: #FFFFFF;
}
Expand Down

0 comments on commit 58eeaf0

Please sign in to comment.