joeroe / risotto

A minimalist, responsive hugo theme inspired by terminal ricing aesthetics.
https://risotto.joeroe.io
MIT License
421 stars 111 forks source link

Add margin and padding to pre blocks #10

Closed mntn-xyz closed 3 years ago

mntn-xyz commented 3 years ago

This puts one character's worth of padding inside each pre block, making the text inside easier to read. It also changes the margin to match the spacing of paragraphs, ensuring that everything is aligned "on the line" as if it is displayed in a terminal.

mntn-xyz commented 3 years ago

I've tested this with both .75 and 1.5 as the horizontal margin and now I'm not sure which one I prefer. Current patch has a .75rem horizontal margin but I'm starting to prefer a 1.5rem margin all around... technically this means that the left/right margins are two characters versus the vertical single character, but visually it looks a little more natural.

.75rem

image

1.5rem

image

joeroe commented 3 years ago

I agree that 1.5 rem all round looks better. It also emulates an empty line plus a two-space indent, which I think is natural.

mntn-xyz commented 3 years ago

Updated patch to use 1.5rem all around.