Skip to content

Conversation

@thasmo
Copy link
Contributor

@thasmo thasmo commented Jan 31, 2026

Pins the package header during scrolling.

package-header-pin.mp4

The template changes look a bit wild, but I basically just kept the now-pinned-content in the already existing <header> element and just moved the rest into a new element below the <header> element.

Eager to get feedback, especially on the checkHeaderPosition function.

❤️

@vercel
Copy link

vercel bot commented Jan 31, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
npmx.dev Ready Ready Preview, Comment Feb 1, 2026 0:31am
2 Skipped Deployments
Project Deployment Actions Updated (UTC)
docs.npmx.dev Ignored Ignored Preview Feb 1, 2026 0:31am
npmx-lunaria Ignored Ignored Feb 1, 2026 0:31am

Request Review

@thasmo
Copy link
Contributor Author

thasmo commented Jan 31, 2026

Ah, something's messed up. Going to fix this. 🤔

@thasmo
Copy link
Contributor Author

thasmo commented Jan 31, 2026

Ah, something's messed up. Going to fix this. 🤔

Should be fine now.

@43081j
Copy link
Collaborator

43081j commented Jan 31, 2026

Is it not possible to have a sticky header through CSS rather than manually adding a scroll listener?

Maybe I'm missing something 🤔

@thasmo
Copy link
Contributor Author

thasmo commented Jan 31, 2026

Is it not possible to have a sticky header through CSS rather than manually adding a scroll listener?

It is! It's "only" needed for the bottom border, which gets added conditionally when the header is in the "pinned state".

@43081j
Copy link
Collaborator

43081j commented Feb 1, 2026

ooh yeah i understand now! thanks for clarifying.

its a shame CSS doesn't have a pseudo-class for this 😅

@43081j 43081j added this pull request to the merge queue Feb 1, 2026
Merged via the queue into npmx-dev:main with commit 3ae8375 Feb 1, 2026
13 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.

3 participants