From 9131cf00a3ddee8b1d0472d0f7df7f58813d216c Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Mon, 2 Nov 2020 14:49:59 +0100 Subject: [PATCH] load images when they becomes partly into view --- src/platform/web/ui/css/themes/element/theme.css | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/platform/web/ui/css/themes/element/theme.css b/src/platform/web/ui/css/themes/element/theme.css index a87b3715..d2b0d229 100644 --- a/src/platform/web/ui/css/themes/element/theme.css +++ b/src/platform/web/ui/css/themes/element/theme.css @@ -561,6 +561,13 @@ so the timeline doesn't jump when the image loads */ align-self: start; border-radius: 4px; } +/* stretch the image (to the spacer) on platforms +where we can trust the spacer to always have the correct height, +otherwise the image starts with height 0 and with loading=lazy +only loads when the top comes into view*/ +.hydrogen:not(.legacy) .message-container .picture > img { + align-self: stretch; +} .message-container .picture > time { align-self: end;