From c386841e784f12ac147a97b2e59da2637de4558c Mon Sep 17 00:00:00 2001 From: PikachuEXE Date: Fri, 1 Mar 2024 21:34:35 +0800 Subject: [PATCH] Make video thumbnails have certain height before image loading starts to avoid layout shifts (#4723) * * Make video thumbnails have certain height before image loading starts to avoid layout shifts * * Use "fallback to natural aspect ratio" feature of `aspect-ratio` --- src/renderer/components/ft-list-video/ft-list-video.scss | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/renderer/components/ft-list-video/ft-list-video.scss b/src/renderer/components/ft-list-video/ft-list-video.scss index 9969e06fc..7512ac8a6 100644 --- a/src/renderer/components/ft-list-video/ft-list-video.scss +++ b/src/renderer/components/ft-list-video/ft-list-video.scss @@ -3,3 +3,8 @@ .thumbnailLink:hover { outline: 3px solid var(--side-nav-hover-color); } + +.thumbnailImage { + // Makes img element sized correctly before image loading starts + aspect-ratio: 16/9 auto; +}