From 100abd26afcae36ef678f443cf2ff5431756924c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micka=C3=ABl=20Canouil?= <8896044+mcanouil@users.noreply.github.com> Date: Thu, 5 Nov 2026 15:48:57 +0100 Subject: [PATCH 1/2] fix: centre the highlighted-lines chip text The chip's line box keeps room for descenders that a label such as "L1-3" never uses, so in Chromium the text sat about 1px above the middle. Browsers that support text-box now trim the line box to the cap height and the baseline, and the padding sets the space instead. Firefox does not support text-box yet and keeps the old layout. --- CHANGELOG.md | 4 ++++ _extensions/code-window/style.css | 10 ++++++++++ 2 files changed, 14 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9de8113..e783dee 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`. The label no longer sits closer to the top border. + ## 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, From c7b146e3d2c57c5ac5d5464abb564218c7665434 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micka=C3=ABl=20Canouil?= <8896044+mcanouil@users.noreply.github.com> Date: Thu, 5 Nov 2026 15:50:16 +0100 Subject: [PATCH 2/2] docs: shorten the chip changelog entry [skip ci] --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e783dee..dc0a7ee 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,7 @@ ### Bug Fixes -- fix: Centre the text of the highlighted-lines chip vertically in browsers that support `text-box`. The label no longer sits closer to the top border. +- fix: Centre the text of the highlighted-lines chip vertically in browsers that support `text-box`. (#86) ## 1.8.1 (2026-11-05)