Skip to content

Conditionally add shadow to site header#11

Merged
mbwatson merged 1 commit intostagecc:mainfrom
mbwatson:enhancement/site-header-shadow
Mar 4, 2026
Merged

Conditionally add shadow to site header#11
mbwatson merged 1 commit intostagecc:mainfrom
mbwatson:enhancement/site-header-shadow

Conversation

@mbwatson
Copy link
Copy Markdown
Member

@mbwatson mbwatson commented Mar 4, 2026

Description

We conditionally style the SiteHeader component with a subtle shadow, based on the scroll amount.

Implementation

The site header component tracks window.scrollY via a passive scroll listener and applies the .scrolled CSS module class (with the drop-shadow) when the page has been scrolled down. At the very top, there is no shadow.

At the top

Screenshot from 2026-03-04 08-16-30

Scroll down some

Screenshot from 2026-03-04 08-16-37

How to validate

View the site, and see no shadow on the site header. Scroll down a bit, and see the shadow appear.

the header now tracks window.scrollY via a passive scroll listener and applies
the `.scrolled` CSS module class (with the drop-shadow) when the page has been
scrolled down. at the very top, there is no shadow.

lint
Copy link
Copy Markdown
Collaborator

@suejinkim20 suejinkim20 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great!

@mbwatson mbwatson merged commit d72f443 into stagecc:main Mar 4, 2026
3 checks passed
@mbwatson mbwatson deleted the enhancement/site-header-shadow branch March 5, 2026 19:01
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