diff --git a/CHANGELOG.md b/CHANGELOG.md index 9de8113..dc0a7ee 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ ## Unreleased +### Bug Fixes + +- fix: Centre the text of the highlighted-lines chip vertically in browsers that support `text-box`. (#86) + ## 1.8.1 (2026-11-05) ### Bug Fixes diff --git a/_extensions/code-window/style.css b/_extensions/code-window/style.css index c739eb2..c4f886d 100644 --- a/_extensions/code-window/style.css +++ b/_extensions/code-window/style.css @@ -95,6 +95,16 @@ body.quarto-dark .code-with-filename .code-with-filename-file { overflow-wrap: break-word; } +/* The line box keeps room for descenders that a label such as "L1-3" does not + * have. Trim it to the cap height and the baseline, so the padding alone sets + * the space above and below the text. */ +@supports (text-box: trim-both cap alphabetic) { + .code-with-filename .code-with-filename-file .code-with-filename-lines { + padding-block: 0.3em; + text-box: trim-both cap alphabetic; + } +} + /* Code block content area */ .code-with-filename .sourceCode, .code-with-filename div.sourceCode,