From 33446091d2ebbed21e8a728db03495f9f34e1696 Mon Sep 17 00:00:00 2001 From: Zanie Blue Date: Thu, 16 Jan 2025 15:02:43 -0600 Subject: [PATCH] Improve the styling of collapsible nav items (#10692) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit I've been a bit unhappy with the collapsible project section. I think it feels a little crowded and consequently hard to read. Here, we tweak the styling to decrease the font size a little and increase the margins. I aimed for a subtle change — we can change it more drastically later if we want. Before Screenshot 2025-01-16 at 12 35 38 PM After Screenshot 2025-01-16 at 12 35 16 PM --- docs/stylesheets/extra.css | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/docs/stylesheets/extra.css b/docs/stylesheets/extra.css index f64e134f6..79cb0b712 100644 --- a/docs/stylesheets/extra.css +++ b/docs/stylesheets/extra.css @@ -158,6 +158,18 @@ because the nav is in a hamburger menu anyway margin-bottom: 0.75em; margin-top: 1em; } + /* Decrease the font size of items in a collapsible section */ + .md-nav__item--section> .md-nav > .md-nav__list > .md-nav__item > .md-nav > .md-nav__list { + font-size: 0.725rem; + } + /* Increase top margin on the first item of a collapsible section */ + .md-nav__item--section> .md-nav > .md-nav__list > .md-nav__item > .md-nav > .md-nav__list > .md-nav__item:first-of-type { + margin-top: 0.5em; + } + /* Increase bottom margin on the last item of a collapsible section */ + .md-nav__item--section> .md-nav > .md-nav__list > .md-nav__item > .md-nav > .md-nav__list > .md-nav__item:last-of-type { + margin-bottom: 0.575em; + } /* Increase the size of the first nav item to match the sections It has no children, so it is not considered a section */ .md-nav--primary > .md-nav__list > .md-nav__item:first-of-type {