From 53119133f23f5e489dac550ae3f0db417c36b0ea Mon Sep 17 00:00:00 2001 From: Chris Sewell Date: Sun, 23 Jun 2024 00:19:43 +0200 Subject: [PATCH] [docs] Keep top-bar visible (#12464) This commit ensures the top-bar is always visible, rather than being hidden on scrolling or navigating to a target. --- doc/_themes/sphinx13/static/sphinx13.css | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/doc/_themes/sphinx13/static/sphinx13.css b/doc/_themes/sphinx13/static/sphinx13.css index 49156ad56..13c451fba 100644 --- a/doc/_themes/sphinx13/static/sphinx13.css +++ b/doc/_themes/sphinx13/static/sphinx13.css @@ -20,6 +20,10 @@ body { } .pageheader { + position: sticky; + top: 0; + z-index: 99; + height: 3rem; display: flex; column-gap: 1em; align-items: center; @@ -80,6 +84,9 @@ div.body { } div.related { + position: sticky; + top: 3rem; + z-index: 99; display: flex; color: white; background-color: var(--colour-sphinx-blue); @@ -107,16 +114,15 @@ div.sphinxsidebarwrapper { div.sphinxsidebar { position: sticky; - top: 0; + top: 4.6rem; align-self: flex-start; - height: 100vh; + height: calc(100vh - 4.6rem); width: 250px; min-width: 150px; overflow-y: auto; overflow-wrap: break-word; margin: 0; - padding-right: 15px; - padding-top: 0.5em; + padding: 0.5em 15px 0.5em 10px; font-size: 1em; } @@ -207,6 +213,11 @@ div.footer a { /* -- body styles ----------------------------------------------------------- */ +.body :target { + /* ensure targets are not obscured by top-bar when they are navigated to */ + scroll-margin-top: 6.5rem; +} + p { margin: 0.8em 0 0.5em 0; }