From 269ccc1bef0ab23072074c7470e6dcda8397e525 Mon Sep 17 00:00:00 2001 From: Edward Loveall Date: Sun, 17 Jul 2022 13:09:34 -0400 Subject: [PATCH] Scroll long code blocks This sets the width of code blocks to be the width of the page, and adds a scrollbar for long blocks. Article `c146e768bb41` has some examples. I could have also wrapped the codeblocks, but as pointed out by [~kaki87] this often reduces readability. Hence: scrollbars. [~kaki87]: https://todo.sr.ht/~edwardloveall/Scribe/6#event-188395 --- CHANGELOG | 1 + src/css/app.css | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/CHANGELOG b/CHANGELOG index aa1d1ce..d90eb3c 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -3,6 +3,7 @@ * Fix source code link * Upgrade to Lucky 0.30.1 * Upgrade to Crystal 1.5.0 +* Add scrollbar to long code blocks 2022-05-21 diff --git a/src/css/app.css b/src/css/app.css index a87e8c7..3799385 100644 --- a/src/css/app.css +++ b/src/css/app.css @@ -34,3 +34,10 @@ figure iframe { footer p span { margin-right: 1em; } + +pre { + background-color: rgba(127, 127, 127, 0.1); + padding: 1em; + overflow-x: scroll; + width: 100%; +}