From c299e128ab2b909c7b123f7f5db9932d85bc6507 Mon Sep 17 00:00:00 2001 From: robin <8597693+robrobinbin@users.noreply.github.com> Date: Thu, 21 Jan 2021 00:12:54 +0100 Subject: [PATCH] Inline images rework --- static/style.css | 22 +++++++++++++++++++--- templates/subreddit.html | 2 +- 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/static/style.css b/static/style.css index e9f9319..aa9a6ce 100644 --- a/static/style.css +++ b/static/style.css @@ -522,14 +522,30 @@ a.search_subreddit:hover { } .post_media { + grid-area: post_media; + text-align: center; +} + +.post_media img { max-width: calc(100% - 40px); - align-self: center; margin-top: 15px; margin: 5px auto; height: auto; - grid-area: post_media; background-color: var(--highlighted); - display: table; + display: block; + width: auto; + color: transparent; + /* TODO, add background image placeholder? */ + /* + + + + + */ +} + +.post_media img.short { + max-height: 512px; } #post_url { diff --git a/templates/subreddit.html b/templates/subreddit.html index becf8cf..5dbba2c 100644 --- a/templates/subreddit.html +++ b/templates/subreddit.html @@ -55,7 +55,7 @@

{% if (prefs.layout.is_empty() || prefs.layout == "card") && post.post_type == "image" %} - Post image + Post image {% else if post.post_type != "self" %} {% if post.thumbnail.url.is_empty() %}