Skip to content

Commit cb265d9

Browse files
authored
Merge pull request #2890 from appwrite/fix-reduce-layout-shift-in-blogs
fix: layout shift in blogs
2 parents 8b44fad + e966135 commit cb265d9

3 files changed

Lines changed: 6 additions & 6 deletions

File tree

src/lib/components/Article.svelte

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@
2222
</script>
2323

2424
<li>
25-
<a class="block overflow-hidden rounded-lg bg-transparent" {href}>
25+
<a class="block w-full overflow-hidden rounded-lg bg-transparent" {href}>
2626
<Media
2727
src={cover}
28-
class="aspect-video transition-transform duration-250 hover:scale-105"
28+
class="web-u-media-ratio-16-9 w-full transition-transform duration-250 hover:scale-105"
2929
alt={title}
3030
autoplay
3131
controls={false}

src/lib/components/blog/article.svelte

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@
2121
</script>
2222

2323
<div class="group flex w-full flex-col gap-8 pb-3 transition">
24-
<a class="block overflow-hidden rounded-lg bg-transparent" {href}>
24+
<a class="block w-full overflow-hidden rounded-lg bg-transparent" {href}>
2525
<Media
2626
src={cover}
27-
class="aspect-video transition duration-250 ease-in-out group-hover:scale-105"
27+
class="web-u-media-ratio-16-9 w-full transition duration-250 ease-in-out group-hover:scale-105"
2828
alt={title}
2929
/>
3030
</a>

src/routes/blog/[[page]]/+page.svelte

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -222,11 +222,11 @@
222222
<article class="web-feature-article mt-12">
223223
<a
224224
href={featured.href}
225-
class="web-feature-article-image h-fit overflow-hidden rounded-lg"
225+
class="web-feature-article-image block w-full overflow-hidden rounded-lg"
226226
>
227227
<img
228228
src={featured.cover}
229-
class="aspect-video transition-transform duration-250 hover:scale-102"
229+
class="web-u-media-ratio-16-9 w-full transition-transform duration-250 hover:scale-102"
230230
loading="lazy"
231231
alt="cover"
232232
/>

0 commit comments

Comments
 (0)