Merge pull request 'fix(nav): cancel full fixed-nav reserve under homepage hero' (#187) from worktree-fix-profile-credits-sidebar into main

Reviewed-on: CYL/wordpress-theme-aksrt#187
This commit is contained in:
kate522 committed 2026-07-17 09:33:17 +08:00
commit e0f1e0a8ad
2 files changed
+20 -11

No files matched your search

@@ -11,10 +11,12 @@
} }
} }
/* CMS freeform modules only: hero as first module under nav */ /* CMS freeform modules only: hero as first module under nav.
* Prefer --nav-fixed-reserve when body.nav-fixed is present so the pull-up
* matches body padding-top (88/72/60), not just the 60px bar height. */
.home-modules > .header-components-container:first-child, .home-modules > .header-components-container:first-child,
.home-modules--fullbleed > .header-components-container:first-child { .home-modules--fullbleed > .header-components-container:first-child {
margin-top: calc(var(--nav-height, 60px) * -1); margin-top: calc(var(--nav-fixed-reserve, var(--nav-height, 60px)) * -1);
} }
/* Fixed homepage hero under-nav is owned by nav/base.css (body.nav-fixed). */ /* Fixed homepage hero under-nav is owned by nav/base.css (body.nav-fixed). */
@@ -41,7 +43,7 @@
} }
.header-components.slide-header .header-components__content.slide-text { .header-components.slide-header .header-components__content.slide-text {
padding-top: var(--nav-height, 60px); padding-top: var(--nav-fixed-reserve, var(--nav-height, 60px));
} }
/* WordPress Admin Bar 已全局禁用,无需偏移规则 */ /* WordPress Admin Bar 已全局禁用,无需偏移规则 */
+15 -8
View File
@@ -1,23 +1,28 @@
/* Zibll body.nav-fixed: hard 88px reserve (main.css), not bare --nav-height. /* Zibll body.nav-fixed: hard 88px reserve (main.css), not bare --nav-height.
* Nav bar itself is ~60px; extra space matches zibll chrome/shadow gap. */ * Nav bar itself is ~60px; extra space matches zibll chrome/shadow gap.
* --nav-fixed-reserve is shared with the hero pull-up so they cancel exactly
* (zibll: body padding-top 88px + .slide-header { margin-top: -90px }). */
body.nav-fixed { body.nav-fixed {
padding-top: 88px; --nav-fixed-reserve: 88px;
padding-top: var(--nav-fixed-reserve);
} }
@media (max-width: 768px) { @media (max-width: 768px) {
body.nav-fixed { body.nav-fixed {
padding-top: 72px; --nav-fixed-reserve: 72px;
padding-top: var(--nav-fixed-reserve);
} }
} }
@media (max-width: 640px) { @media (max-width: 640px) {
body.nav-fixed { body.nav-fixed {
padding-top: 60px; --nav-fixed-reserve: 60px;
padding-top: var(--nav-fixed-reserve);
} }
} }
/* Fixed nav without hero overlay: take header out of flow. /* Fixed nav without hero overlay: take header out of flow.
body.nav-fixed already reserves --nav-height via padding-top. */ body.nav-fixed already reserves space via padding-top. */
body.nav-fixed .header:not(.show-slide) { body.nav-fixed .header:not(.show-slide) {
position: fixed; position: fixed;
top: 0; top: 0;
@@ -41,14 +46,16 @@ body.nav-fixed .header:not(.show-slide) .navbar.navbar-top {
*/ */
body.nav-fixed:not(:has(.header.show-slide)) .fluid-widget-wrap:first-of-type:empty + main.container, body.nav-fixed:not(:has(.header.show-slide)) .fluid-widget-wrap:first-of-type:empty + main.container,
body.nav-fixed:not(:has(.header.show-slide)) main.container:first-of-type { body.nav-fixed:not(:has(.header.show-slide)) main.container:first-of-type {
scroll-margin-top: calc(var(--nav-height, 60px) + 8px); scroll-margin-top: calc(var(--nav-fixed-reserve, 88px) + 8px);
} }
/* Hero sits under transparent fixed/absolute header (zibll slide-header) */ /* Hero sits under transparent fixed/absolute header.
* MUST cancel the full --nav-fixed-reserve (88/72/60), not just --nav-height (60).
* Using only -60px against 88px padding left a ~28px blank strip above the hero. */
body.nav-fixed .header-slider-container, body.nav-fixed .header-slider-container,
body.nav-fixed .header-components-container, body.nav-fixed .header-components-container,
body.nav-fixed .header-components.slide-header { body.nav-fixed .header-components.slide-header {
margin-top: calc(var(--nav-height, 60px) * -1) !important; margin-top: calc(var(--nav-fixed-reserve, 88px) * -1) !important;
position: relative; position: relative;
z-index: 1; z-index: 1;
} }