From d1d53c9537a1d9c52a885a4380984ac8854db7c4 Mon Sep 17 00:00:00 2001 From: Luna D Date: Mon, 4 Oct 2021 21:43:06 +0200 Subject: [PATCH] ensure image doesn't try to be larger than width --- assets/css/common/_base.scss | 28 +++++++++++----------------- 1 file changed, 11 insertions(+), 17 deletions(-) diff --git a/assets/css/common/_base.scss b/assets/css/common/_base.scss index 7e321f92..1e8e1fc2 100644 --- a/assets/css/common/_base.scss +++ b/assets/css/common/_base.scss @@ -308,25 +308,19 @@ blockquote blockquote blockquote blockquote blockquote blockquote { margin-bottom: 6px; } -img[alt=tiny] { - max-height: $image_tiny_size !important; - max-width: $image_tiny_size !important; +@mixin image-alt-size($name, $size) { + @media (min-width: $size) { + img[alt=#{$name}] { + max-height: $size !important; + max-width: $size !important; + } + } } -img[alt=small] { - max-height: $image_small_size !important; - max-width: $image_small_size !important; -} - -img[alt=medium] { - max-height: $image_medium_size !important; - max-width: $image_medium_size !important; -} - -img[alt=large] { - max-height: $image_large_size !important; - max-width: $image_large_size !important; -} +@include image-alt-size(tiny, $image_tiny_size); +@include image-alt-size(small, $image_small_size); +@include image-alt-size(medium, $image_medium_size); +@include image-alt-size(large, $image_large_size); table { @extend .table;