From aa52338289d4d5aa7e04c2b59398df87c59021ff Mon Sep 17 00:00:00 2001 From: ZhenShuo Leo <98386542+ZhenShuo2021@users.noreply.github.com> Date: Thu, 27 Aug 2026 21:58:03 +0800 Subject: [PATCH] fix: mobile menu wrong height caused by new stacking context from backdrop-blur --- assets/css/compiled/main.css | 6 +----- assets/css/main.css | 11 +---------- layouts/partials/header/components/mobile-menu.html | 4 ++-- layouts/partials/header/floating.html | 8 ++++++-- 4 files changed, 10 insertions(+), 19 deletions(-) diff --git a/assets/css/compiled/main.css b/assets/css/compiled/main.css index 151dfb67..17721ab4 100644 --- a/assets/css/compiled/main.css +++ b/assets/css/compiled/main.css @@ -4877,7 +4877,7 @@ pre { } } } -body:has(#mobile-menu-toggle:checked) { +body:has(#mobile-menu-toggle:checked):not(:has(#mobile-menu-dialog.mobile-menu-style-dropdown)) { overflow: hidden; } @media (min-width: 853px) { @@ -4900,10 +4900,6 @@ body:has(#mobile-menu-toggle:checked) { visibility: hidden; transition: visibility 0.3s, opacity 0.3s ease-in-out; } -header > div:has(.mobile-menu-fullscreen #mobile-menu-toggle:checked) { - -webkit-backdrop-filter: none; - backdrop-filter: none; -} .nested-menu:nth-last-child(-n + 3) .menuhide, .mobile-header-row .menuhide { inset-inline-end: 0; } diff --git a/assets/css/main.css b/assets/css/main.css index d51295d9..4971cc5e 100644 --- a/assets/css/main.css +++ b/assets/css/main.css @@ -451,7 +451,7 @@ pre { } /* Prevent body scroll when mobile menu is open */ -body:has(#mobile-menu-toggle:checked) { +body:has(#mobile-menu-toggle:checked):not(:has(#mobile-menu-dialog.mobile-menu-style-dropdown)) { overflow: hidden; } @@ -485,15 +485,6 @@ body:has(#mobile-menu-toggle:checked) { opacity 0.3s ease-in-out; } -/* A backdrop-filter turns the header pill into a containing block for - position:fixed descendants, which would trap the fullscreen mobile menu - inside it. Lift the filter while that menu is open — the fullscreen - overlay covers the header anyway, so the change is invisible. */ -header > div:has(.mobile-menu-fullscreen #mobile-menu-toggle:checked) { - -webkit-backdrop-filter: none; - backdrop-filter: none; -} - /* Dropdowns near the end of the bar open leftward so they stay on screen */ .nested-menu:nth-last-child(-n + 3) .menuhide, .mobile-header-row .menuhide { diff --git a/layouts/partials/header/components/mobile-menu.html b/layouts/partials/header/components/mobile-menu.html index 4465f30f..8033deeb 100644 --- a/layouts/partials/header/components/mobile-menu.html +++ b/layouts/partials/header/components/mobile-menu.html @@ -1,5 +1,5 @@ {{ $mobileMenuStyle := .Site.Params.header.mobileMenuStyle | default "fullscreen" }} -