Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions layouts/partials/header.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<nav class="top-nav-bar transition-all">
<div class="top-nav-container lg:container lg:px-4 flex-wrap justify-end">
{{ partial "banner" . }}
<div class="w-full p-4">
<div class="hidden lg:block w-full p-4">
<ul class="hidden w-full lg:flex justify-end items-center order-first lg:order-last">
<li class="github-widget mr-8">
<a data-track="header-github-pulumi" class="github-button" href="https://github.com/pulumi/pulumi"
Expand Down Expand Up @@ -357,7 +357,7 @@
<label class="mobile-menu-closed" for="mobile-menu">
{{ partial "icon" (dict "icon" "hamburger-closed") }}
</label>
<label class="mobile-menu-open hidden" for="mobile-menu">
<label class="mobile-menu-open" for="mobile-menu">
{{ partial "icon" (dict "icon" "hamburger-open") }}
</label>
</span>
Expand Down
31 changes: 29 additions & 2 deletions theme/src/scss/_header.scss
Original file line number Diff line number Diff line change
Expand Up @@ -350,13 +350,17 @@ pulumi-user-toggle:not(.hydrated) [slot="signed-in"] {
@apply hidden;
}

.mobile-menu-icon .mobile-menu-open {
display: none;
}

.mobile-menu-toggle:checked + .mobile-menu-icon {
.mobile-menu-closed {
@apply hidden;
display: none;
}

.mobile-menu-open {
@apply block;
display: block;
}
}

Expand Down Expand Up @@ -530,6 +534,29 @@ pulumi-user-toggle:not(.hydrated) [slot="signed-in"] {
}
}

html:has(.mobile-menu-toggle:checked) {
overflow: hidden;

.header-container {
position: fixed;
top: 0;
left: 0;
right: 0;

&.is-pinned {
top: -1px;
}
}

@include screen-lg {
overflow: auto;

.header-container {
position: sticky;
}
}
}

.registry-hero, .docs-hero {
@apply w-full flex relative flex-col justify-center;

Expand Down
4 changes: 4 additions & 0 deletions theme/src/ts/misc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,10 @@ export function generateOnThisPage() {
(function () {
const observer = new IntersectionObserver(
([e]) => {
const mobileMenuToggle = document.getElementById("mobile-menu") as HTMLInputElement | null;
if (mobileMenuToggle?.checked) {
return;
}
e.target.classList.toggle("is-pinned", e.intersectionRatio < 1);
const pinnedSearchContainerEl = document.querySelector(".header-pinned") as HTMLElement;
const dotOverlay = document.querySelector(".hide-on-pinned") as HTMLElement;
Expand Down
Loading