From c763d15eaa7c1f8480ce1dd7aea0f86bdf9e0c6e Mon Sep 17 00:00:00 2001 From: "Danilo M." Date: Sat, 18 Apr 2026 19:37:25 +0200 Subject: fix: remove whitespace gaps and restore font size in code blocks - Add not-prose to .code-block-wrapper to opt out of Tailwind Typography styles (table margins were causing the empty line gaps above/below code) - Restore font-size: 0.875em on pre and code since not-prose removed the Typography plugin's size normalization Co-Authored-By: Claude Sonnet 4.6 --- themes/danix-xyz-hacker/assets/css/chroma-custom.css | 14 ++++++++++++++ .../layouts/_default/_markup/render-codeblock.html | 4 ++-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/themes/danix-xyz-hacker/assets/css/chroma-custom.css b/themes/danix-xyz-hacker/assets/css/chroma-custom.css index ef43ce2..d632e09 100644 --- a/themes/danix-xyz-hacker/assets/css/chroma-custom.css +++ b/themes/danix-xyz-hacker/assets/css/chroma-custom.css @@ -119,6 +119,15 @@ overflow-x: visible; } +/* Re-apply padding after the reset above, with higher specificity */ +.code-block-wrapper .highlight .lntd:first-child pre { + padding: 0.875rem 0; +} + +.code-block-wrapper .highlight .lntd:last-child pre { + padding: 0.875rem 1rem; +} + /* === Chroma table layout (lineNumbersInTable = true) === */ .highlight table { @@ -161,6 +170,11 @@ overflow-x: auto; } +.code-block-wrapper pre, +.code-block-wrapper code { + font-size: 0.875em; +} + /* === Syntax token colors (dark theme default) === */ .highlight { diff --git a/themes/danix-xyz-hacker/layouts/_default/_markup/render-codeblock.html b/themes/danix-xyz-hacker/layouts/_default/_markup/render-codeblock.html index 2b48840..6f3e357 100644 --- a/themes/danix-xyz-hacker/layouts/_default/_markup/render-codeblock.html +++ b/themes/danix-xyz-hacker/layouts/_default/_markup/render-codeblock.html @@ -4,7 +4,7 @@ {{- if not $hasLang -}}{{- $highlightLang = "text" -}}{{- end -}} {{- $opts := dict "lineNos" true "lineNumbersInTable" true -}} -
+
{{- if $hasLang -}}
{{ $lang }} @@ -18,6 +18,6 @@
{{- end -}}
- {{ highlight .Inner $highlightLang $opts }} +{{- highlight .Inner $highlightLang $opts -}}
-- cgit v1.2.3