From 5218972b06d5694b8b3f433a1d3b69230f02307f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6ren=20Weber?= Date: Thu, 15 Jun 2023 21:57:08 +0200 Subject: [PATCH] syntaxhighlight: fix borders using highlight shortcode #569 --- static/css/theme.css | 31 +++++++++++++++++++++++-------- 1 file changed, 23 insertions(+), 8 deletions(-) diff --git a/static/css/theme.css b/static/css/theme.css index df5b77f121..8735c1da55 100644 --- a/static/css/theme.css +++ b/static/css/theme.css @@ -625,11 +625,6 @@ code { white-space: nowrap; } -.chroma td.lntd:nth-child(2){ - /* if highlight shortcode used in table mode, increase code column to full width */ - width: 100%; -} - span.copy-to-clipboard { display: inline-block; white-space: nowrap; @@ -671,6 +666,22 @@ pre code { white-space: inherit; } +/* increase code column to full width if highlight shortcode was used in table lineno mode */ +td.lntd:nth-child(2){ + width: 100%; +} + +/* remove border from lineno column if highlight shortcode was used in table lineno mode */ +td.lntd > pre.chroma:not(.pre-code) { + border-bottom-right-radius: 0; + border-right-width: 0; + border-top-right-radius: 0; +} +td.lntd:nth-child(2) pre { + border-bottom-left-radius: 0; + border-top-left-radius: 0; +} + hr { border-bottom: 4px solid rgba( 134, 134, 134, .125 ); } @@ -1964,8 +1975,12 @@ html[dir="rtl"] #sidebar ul.collapsible-menu > li > label > i.fa-chevron-right { padding: 0; } -/* remove border from a code block if single */ -#body .tab-content-text > div.highlight:only-child > pre, +/* remove border from code block if single in tab */ +#body .tab-content-text > div.highlight:only-child pre, #body .tab-content-text > pre.pre-code:only-child{ - border: 0; + border-width: 0; +} +/* re-add border on code column if a single in tab and highlight shortcode was used in table lineno mode */ +#body .tab-content-text > div.highlight:only-child td.lntd:nth-child(2) pre { + border-left-width: 1px; }