diff --git a/docs/assets/javascript/theme.js b/docs/assets/javascript/theme.js index c0637453..25423f2f 100644 --- a/docs/assets/javascript/theme.js +++ b/docs/assets/javascript/theme.js @@ -20,5 +20,18 @@ function checkScrollPosition() { } } +function initDropdownToggle() { + document.querySelectorAll(".esi-nav-header-item-dropdown").forEach((item) => { + item.addEventListener("click", (event) => { + if (item.dataset.open) { + delete item.dataset.open; + } else { + item.dataset.open = "true"; + } + }); + }); +} + window.addEventListener("scroll", checkScrollPosition); window.addEventListener("load", checkScrollPosition); +window.addEventListener("load", initDropdownToggle); diff --git a/docs/assets/stylesheet/theme.css b/docs/assets/stylesheet/theme.css index 5ee79d86..f07d6451 100644 --- a/docs/assets/stylesheet/theme.css +++ b/docs/assets/stylesheet/theme.css @@ -44,6 +44,10 @@ padding: 0 0 8.6px; } + .md-header > .md-grid > .md-header__button:hover { + opacity: 1; + } + .md-header > .md-grid > .md-header__title { margin-left: 0; } @@ -202,6 +206,10 @@ body::before { z-index: -1; } +[data-scrolled] .md-header { + backdrop-filter: blur(4px); +} + .md-header__source { width: var(--source-width); margin-left: 0.5rem; @@ -661,6 +669,52 @@ body::before { width: calc(100% - 16px); } +.esi-nav-header-item.esi-nav-header-item-dropdown { + display: flex; + flex-direction: row; + gap: 6px; + cursor: pointer; +} + +.esi-nav-header-item.esi-nav-header-item-dropdown svg { + height: 18px; + width: 18px; + transition: transform 0.2s ease-in-out; + align-self: center; +} +.esi-nav-header-item.esi-nav-header-item-dropdown[data-open] svg { + transform: scaleY(-1); +} + +.esi-nav-header-item-dropdown .esi-nav-header-dropdown-container { + display: none; + position: absolute; + top: 100%; + left: 0; + background-color: var(--esi-smokey-black); + box-shadow: var(--md-shadow-z2); + min-width: 195px; + padding: 13px 6px; + font-size: 16px; + line-height: 24px; + z-index: 10; + flex-direction: column; +} + +.esi-nav-header-item-dropdown .esi-nav-header-dropdown-container a { + padding: 5px 12px; + text-align: left; +} + +.esi-nav-header-item-dropdown .esi-nav-header-dropdown-container a:hover { + text-decoration: none; + color: var(--esi-accent); +} + +.esi-nav-header-item-dropdown[data-open] .esi-nav-header-dropdown-container { + display: flex; +} + @media screen and (min-width: 60em) { .esi-sidebar .md-nav { margin-bottom: 0; diff --git a/overrides/partials/header.html b/overrides/partials/header.html index d7be7975..3e26b770 100644 --- a/overrides/partials/header.html +++ b/overrides/partials/header.html @@ -32,11 +32,14 @@
-