From c103690644dcd3890a7e8bfc68df56c4d419b734 Mon Sep 17 00:00:00 2001 From: Jade Lovelace Date: Fri, 9 Aug 2024 21:56:37 -0700 Subject: [PATCH] theme: distinguish code better I found it really hard to read what was actually code, so this change adds a very subtle hint of colour around all the code which has cheeky border radii. I've also cheekily made the font a tiny bit smaller for inline code so that even with the required padding, it does not mess up the line spacing visibly. --- .../lix/assets/scss/shared/_blockquote.scss | 21 +++++++++++++++++++ themes/lix/assets/scss/shared/_code.scss | 12 +++++++++++ themes/lix/assets/scss/shared/shared.scss | 2 ++ 3 files changed, 35 insertions(+) create mode 100644 themes/lix/assets/scss/shared/_blockquote.scss create mode 100644 themes/lix/assets/scss/shared/_code.scss diff --git a/themes/lix/assets/scss/shared/_blockquote.scss b/themes/lix/assets/scss/shared/_blockquote.scss new file mode 100644 index 00000000..9dd765e1 --- /dev/null +++ b/themes/lix/assets/scss/shared/_blockquote.scss @@ -0,0 +1,21 @@ +@use 'sass:color'; + +$blockquote-y-padding: 0.7rem; + +blockquote { + border-left-color: desaturate($primary, 20%); + border-left-width: 0.4rem; + border-left-style: solid; + padding-left: 0.5rem; + padding-top: $blockquote-y-padding; + padding-bottom: $blockquote-y-padding; + + >:first-child { + margin-top: 0; + } + + >:last-child { + margin-bottom: 0; + } +} + diff --git a/themes/lix/assets/scss/shared/_code.scss b/themes/lix/assets/scss/shared/_code.scss new file mode 100644 index 00000000..f7b2df92 --- /dev/null +++ b/themes/lix/assets/scss/shared/_code.scss @@ -0,0 +1,12 @@ +$code-colour: darken($light, 5%); +pre { + background-color: $code-colour; + padding: 0.8rem; + border-radius: 0.5rem; +} +:not(pre)>code { + background-color: $code-colour; + font-size: 0.85em; + padding: 0.2em; + border-radius: 0.3em; +} diff --git a/themes/lix/assets/scss/shared/shared.scss b/themes/lix/assets/scss/shared/shared.scss index ba9e5ae9..6b5dcf48 100644 --- a/themes/lix/assets/scss/shared/shared.scss +++ b/themes/lix/assets/scss/shared/shared.scss @@ -3,6 +3,8 @@ @import "fonts"; @import "utilities"; +@import "blockquote"; +@import "code"; @import "header"; @import "footer"; @import "buttons";