]> danix's work - danix.xyz-2.git/commitdiff
fix: remove whitespace gaps and restore font size in code blocks
authorDanilo M. <redacted>
Sat, 18 Apr 2026 17:37:25 +0000 (19:37 +0200)
committerDanilo M. <redacted>
Sat, 18 Apr 2026 17:37:25 +0000 (19:37 +0200)
- 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 <redacted>
themes/danix-xyz-hacker/assets/css/chroma-custom.css
themes/danix-xyz-hacker/layouts/_default/_markup/render-codeblock.html

index ef43ce29613ac5aa7a13a862cc9fe5772d7d714c..d632e09f9e5c8792f36417153349c62065c3453f 100644 (file)
   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 {
   overflow-x: auto;
 }
 
+.code-block-wrapper pre,
+.code-block-wrapper code {
+  font-size: 0.875em;
+}
+
 /* === Syntax token colors (dark theme default) === */
 
 .highlight {
index 2b48840196400e0170921301697ebd13634026cc..6f3e357681b5bf572731515ed4d0dbb00fe1bdcd 100644 (file)
@@ -4,7 +4,7 @@
 {{- if not $hasLang -}}{{- $highlightLang = "text" -}}{{- end -}}
 {{- $opts := dict "lineNos" true "lineNumbersInTable" true -}}
 
-<div class="code-block-wrapper">
+<div class="code-block-wrapper not-prose">
   {{- if $hasLang -}}
   <div class="code-header" data-lang="{{ $lang }}">
     <span class="code-lang-label">{{ $lang }}</span>
@@ -18,6 +18,6 @@
   </div>
   {{- end -}}
   <div class="code-body">
-    {{ highlight .Inner $highlightLang $opts }}
+{{- highlight .Inner $highlightLang $opts -}}
   </div>
 </div>