From 92c28c0d146b5a386cfa9ed68618f86153b50d92 Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Wed, 11 Aug 2021 21:28:02 +0200 Subject: [PATCH] Limit height of code blocks (#3012) * Limit height of code blocks Users often post lengthy code or configuration listings which makes following the actual discussion difficult. Therefore we limit a code block by half a screen while still being able to scroll through the code listing itself. * Define a minimal code block height for small screens * Add max-height compatibility for browsers that don't support `max()` See https://caniuse.com/css-math-functions * Less has a built-in `max` function, so we need to escape this value Co-authored-by: David Wheatley --- framework/core/less/forum/Post.less | 3 +++ 1 file changed, 3 insertions(+) diff --git a/framework/core/less/forum/Post.less b/framework/core/less/forum/Post.less index 3f3761bd7..93bba10d8 100644 --- a/framework/core/less/forum/Post.less +++ b/framework/core/less/forum/Post.less @@ -147,6 +147,9 @@ border-radius: 0; display: block; overflow-x: auto; + // Backwards compatibility for browsers that don't support `max()` + max-height: 50vh; + max-height: ~"max(50vh, 250px)"; } } h1, h2, h3, h4, h5, h6 {