From mboxrd@z Thu Jan 1 00:00:00 1970 Delivery-date: Sat, 06 May 2023 22:22:57 +0200 Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by lore.white.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1pvOQk-007uTl-KZ for lore@lore.pengutronix.de; Sat, 06 May 2023 22:22:57 +0200 Received: from localhost ([127.0.0.1] helo=metis.ext.pengutronix.de) by metis.ext.pengutronix.de with esmtp (Exim 4.92) (envelope-from ) id 1pvOQh-0000ho-Rx; Sat, 06 May 2023 22:22:55 +0200 Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pvOQE-0000h8-L6; Sat, 06 May 2023 22:22:26 +0200 Received: from [2a0a:edc0:0:1101:1d::ac] (helo=dude04.red.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pvOQD-001bJV-V6; Sat, 06 May 2023 22:22:25 +0200 Received: from rhi by dude04.red.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pvOQC-0016Wq-Rx; Sat, 06 May 2023 22:22:24 +0200 From: Roland Hieber To: ptxdist@pengutronix.de Date: Sat, 6 May 2023 22:22:23 +0200 Message-Id: <20230506202223.263380-3-rhi@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230506202223.263380-1-rhi@pengutronix.de> References: <20230506202223.263380-1-rhi@pengutronix.de> MIME-Version: 1.0 Mail-Followup-To: Roland Hieber , ptxdist@pengutronix.de Content-Transfer-Encoding: 8bit Subject: [ptxdist] [PATCH 3/3] doc: custom.css: fix "View Page Source" align with newer sphinx_rtd_theme X-BeenThere: ptxdist@pengutronix.de X-Mailman-Version: 2.1.29 Precedence: list List-Id: PTXdist Development Mailing List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: ptxdist@pengutronix.de Cc: Roland Hieber Sender: "ptxdist" X-SA-Exim-Connect-IP: 127.0.0.1 X-SA-Exim-Mail-From: ptxdist-bounces@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false sphinx_rtd_theme PR #1073, which went into 1.2.0, removed the vertical-align attribute for the "View Page Source" link, which does not have a big impact on the vanilla sphinx_rtd_theme. However our custom theme hacks add buttons left and right of the breadcrumbs which are higher than the line height, and therefore our custom.css already includes a "vertical-align: middle" to align the text of the chapter marks with the surrounding buttons. However, this doesn't work for the .wy-breadcrumbs-aside elements, which get floated right; therefore they get rendered as "display: block" instead of "display: inline-block", and according to the CSS specification, the "vertical-align" has no effect on "display: block" elements. This has the effect that the "View Source" link is now no longer aligned vertically, but instead is shifted upwards relative to the baseline of the chapter marks. The right way to have left-aligned chapter marks and right-aligned "View Source" link would probably be a flex layout, but that would need another layer of
s to group the left and right elements of the navigation header, which we cannot do here as we only have control over the CSS and not the page structure. Instead, re-apply the display and padding that were removed in PR #1073 (and increase the padding to 7px to account for or higher buttons), which does approximately the right thing, and re-aligns the "View Source" link with the baseline of the chapter marks again. This has no effect on sphinx_rtd_theme < 1.2.0 since the a element and the surrounding .wy-breadcrumbs-aside will be of the same height. Link: https://github.com/readthedocs/sphinx_rtd_theme/pull/1073 Signed-off-by: Roland Hieber --- doc/_static/css/custom.css | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/doc/_static/css/custom.css b/doc/_static/css/custom.css index 7efe0e101774..27add44263d5 100644 --- a/doc/_static/css/custom.css +++ b/doc/_static/css/custom.css @@ -12,6 +12,11 @@ vertical-align: middle; } +/* "View Page Source" link */ +.wy-breadcrumbs .wy-breadcrumbs-aside > a { + display: inline-block; + padding: 7px; +} /* links */ .wy-menu-vertical a:active { -- 2.39.2