From bfc7a2df400b111aa1c90a0622f2293e31738dd1 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Mon, 9 May 2022 20:08:48 +0800 Subject: [PATCH] Update code blocks height It is now the same as in my site. I found it to be surprisingly useful but it needs a little widget like a button to make it fullscreen to make it more accessible especially at larger screens. --- CHANGELOG.adoc | 2 ++ assets/scss/base.scss | 5 +++++ assets/scss/main.scss | 1 + 3 files changed, 8 insertions(+) diff --git a/CHANGELOG.adoc b/CHANGELOG.adoc index 020eae4..f440769 100644 --- a/CHANGELOG.adoc +++ b/CHANGELOG.adoc @@ -22,6 +22,8 @@ and this project adheres to https://semver.org/spec/v2.0.0.html[Semantic Version === Updated +* The code block has maximum height for half the height of the viewport (`50vh`). + * More consistent theming for the content text. diff --git a/assets/scss/base.scss b/assets/scss/base.scss index 6cf47b5..9c97d87 100644 --- a/assets/scss/base.scss +++ b/assets/scss/base.scss @@ -102,6 +102,7 @@ pre { line-height: 1.5; margin-top: 1rem; margin-bottom: 1rem; + max-height: var(--code-block-size); padding: 0.5rem; overflow: auto; } @@ -230,5 +231,9 @@ footer { background: var(--base07); overflow: auto; } + + pre { + max-height: unset; + } } diff --git a/assets/scss/main.scss b/assets/scss/main.scss index ba52285..8255575 100644 --- a/assets/scss/main.scss +++ b/assets/scss/main.scss @@ -9,6 +9,7 @@ --mono-font-size: 0.9em; --vertical-rhythm: 24px; --content-width: 750px; + --code-block-size: 50vh; --border-style: var(--base06) solid 1px; --background: var(--base00);