From mboxrd@z Thu Jan 1 00:00:00 1970 Delivery-date: Thu, 11 May 2023 07:56:22 +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 1pwzHq-00DZmB-Rx for lore@lore.pengutronix.de; Thu, 11 May 2023 07:56:21 +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 1pwzHo-0002Cy-EM; Thu, 11 May 2023 07:56:20 +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 1pwzH5-0001dr-Ja; Thu, 11 May 2023 07:55:35 +0200 Received: from [2a0a:edc0:0:1101:1d::54] (helo=dude05.red.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1pwzH5-002efm-0d; Thu, 11 May 2023 07:55:35 +0200 Received: from mol by dude05.red.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pwzH4-008JCY-DD; Thu, 11 May 2023 07:55:34 +0200 From: Michael Olbrich To: ptxdist@pengutronix.de Date: Thu, 11 May 2023 07:55:34 +0200 Message-Id: <20230511055534.1980427-1-m.olbrich@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230506202223.263380-3-rhi@pengutronix.de> References: <20230506202223.263380-3-rhi@pengutronix.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: Re: [ptxdist] [APPLIED] 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 Thanks, applied as ec2fe71855805d9d27c531be4bf69acdd34ba500. Michael [sent from post-receive hook] On Thu, 11 May 2023 07:55:34 +0200, Roland Hieber wrote: > 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 > Message-Id: <20230506202223.263380-3-rhi@pengutronix.de> > Signed-off-by: Michael Olbrich > > 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 {