From abc521c07d9a6fc575b4baf1232d16094dac5242 Mon Sep 17 00:00:00 2001 From: Christian Kremitzl Date: Sat, 4 May 2019 11:27:17 +0200 Subject: [PATCH] Fix CSS for preview images. --- css/theme/latex.css | 8 +++++--- css/theme/source/latex.scss | 6 ++++-- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/css/theme/latex.css b/css/theme/latex.css index 0662ae5..c6f795b 100644 --- a/css/theme/latex.css +++ b/css/theme/latex.css @@ -79,9 +79,11 @@ body { body .layout-preview img { width: auto; height: auto; - max-width: 90vw; - max-height: 90vh; - box-shadow: 0.2em 0.2em 0.5em 0 rgba(0, 0, 0, 0.3); } + max-width: calc(.9 * var(--square)); + max-height: calc(.9 * var(--square)); + box-shadow: 0.2em 0.2em 0.5em 0 rgba(0, 0, 0, 0.3); + object-fit: cover; + margin: calc(.05 * var(--square)); } body .layout-preview img[src$="-crop.svg"] { background: white; padding: calc(var(--margin) * var(--square)); diff --git a/css/theme/source/latex.scss b/css/theme/source/latex.scss index d0f26f2..aaa94cc 100644 --- a/css/theme/source/latex.scss +++ b/css/theme/source/latex.scss @@ -112,9 +112,11 @@ body { img { width: auto; height: auto; - max-width: 90vw; - max-height: 90vh; + max-width: calc(.9 * var(--square)); + max-height: calc(.9 * var(--square)); box-shadow: .2em .2em .5em 0 rgba(0, 0, 0, .3); + object-fit: cover; + margin: calc(.05 * var(--square)); &[src$="-crop.svg"] { background: white; padding: calc(var(--margin) * var(--square));