Skip to content

fix: auto-hide the header on desktop scroll - #34

Merged
slin1237 merged 1 commit into
smg-project:mainfrom
Aionw:fix/auto-hide-header
Aug 3, 2026
Merged

fix: auto-hide the header on desktop scroll#34
slin1237 merged 1 commit into
smg-project:mainfrom
Aionw:fix/auto-hide-header

Conversation

@Aionw

@Aionw Aionw commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

The header scroll handler already toggled site-header--hidden after downward scrolling, but the matching transform rule lived inside the mobile-only breakpoint. On desktop, the state changed without any visual effect, leaving the full navigation bar pinned at the top.

Move the hidden-state rule to the shared header styles so desktop and mobile both hide on downward scroll and reveal on upward scroll. The existing mobile-menu exception remains intact, keeping the header visible while the menu is open.

Verification

  • prettier --check . / eslint . — clean
  • svelte-check — 0 errors (1 pre-existing warning in HeroMark.svelte, untouched)
  • Production build with Wrangler type check + Vite — succeeds
  • Production output under wrangler pages dev/smg/ returns 200

The scroll handler already marked the header hidden while scrolling down, but the transform was scoped to the mobile breakpoint. Move the hidden-state rule out of the media query so desktop navigation follows the same hide-on-down, reveal-on-up behavior while preserving the mobile-menu exception.

Signed-off-by: Aoi <aione.moe.dev@gmail.com>
@Aionw
Aionw marked this pull request as ready for review August 3, 2026 03:46
@slin1237
slin1237 merged commit f9c1933 into smg-project:main Aug 3, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants