From 2df6d33e6f9d7d3a70b72e16ef80a0162ce7b8d9 Mon Sep 17 00:00:00 2001 From: Tim Hoffmann <2836374+timhoffm@users.noreply.github.com> Date: Sat, 1 Feb 2025 14:42:49 +0100 Subject: [PATCH 1/2] Reduce the height of wrapped navbar Navbar items have been forced the header height. This means if they get wrapped because the window is not wide enough, the navbar will double its height. This costs a lot of vertical space, which is particularly annoying as screens with limited width typically also have limited height. This PR changes the behavior to not force the height. Additionally we set a small vertical margin so that it is ensured that items have a bit of space around them. This approach does not change the visible appearance of the navbar if everything fits in one line. But it reduces the vertical size of the navbar for wrapped content. --- src/pydata_sphinx_theme/assets/styles/sections/_header.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pydata_sphinx_theme/assets/styles/sections/_header.scss b/src/pydata_sphinx_theme/assets/styles/sections/_header.scss index e57d59b568..b4165b0cc0 100644 --- a/src/pydata_sphinx_theme/assets/styles/sections/_header.scss +++ b/src/pydata_sphinx_theme/assets/styles/sections/_header.scss @@ -34,8 +34,8 @@ // These items will define the height of the header .navbar-item { - height: var(--pst-header-height); max-height: var(--pst-header-height); + margin: 4px 0; display: flex; align-items: center; } From c6e69004ed034ae8c212b7cf3e50457f0eb3298e Mon Sep 17 00:00:00 2001 From: Tim Hoffmann <2836374+timhoffm@users.noreply.github.com> Date: Wed, 5 Feb 2025 18:50:33 +0100 Subject: [PATCH 2/2] Update src/pydata_sphinx_theme/assets/styles/sections/_header.scss Co-authored-by: gabalafou --- src/pydata_sphinx_theme/assets/styles/sections/_header.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pydata_sphinx_theme/assets/styles/sections/_header.scss b/src/pydata_sphinx_theme/assets/styles/sections/_header.scss index b4165b0cc0..8e6731eba3 100644 --- a/src/pydata_sphinx_theme/assets/styles/sections/_header.scss +++ b/src/pydata_sphinx_theme/assets/styles/sections/_header.scss @@ -35,7 +35,7 @@ // These items will define the height of the header .navbar-item { max-height: var(--pst-header-height); - margin: 4px 0; + margin: 0.25rem 0; display: flex; align-items: center; }