Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(components,styles): post-header margins and global buttons shrink on scroll #4767

Open
wants to merge 11 commits into
base: main
Choose a base branch
from

Conversation

leagrdv
Copy link
Contributor

@leagrdv leagrdv commented Feb 24, 2025

No description provided.

@leagrdv leagrdv requested a review from a team as a code owner February 24, 2025 15:46
@leagrdv leagrdv linked an issue Feb 24, 2025 that may be closed by this pull request
Copy link

changeset-bot bot commented Feb 24, 2025

🦋 Changeset detected

Latest commit: 4a73c8b

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 15 packages
Name Type
@swisspost/design-system-components Patch
@swisspost/design-system-styles Patch
@swisspost/design-system-components-angular-workspace Patch
@swisspost/design-system-components-react Patch
@swisspost/design-system-documentation Patch
@swisspost/design-system-components-angular Patch
@swisspost/internet-header Patch
@swisspost/design-system-intranet-header-workspace Patch
@swisspost/design-system-nextjs-integration Patch
@swisspost/design-system-styles-primeng-workspace Patch
@swisspost/design-system-intranet-header Patch
@swisspost/design-system-styles-primeng Patch
@swisspost/design-system-intranet-header-showcase Patch
@swisspost/design-system-tokens Patch
@swisspost/design-system-icons Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@leagrdv leagrdv added the Header Everything related to our composible header components label Feb 24, 2025
@swisspost-bot
Copy link
Contributor

swisspost-bot commented Feb 24, 2025

Related Previews

@gfellerph gfellerph self-requested a review February 24, 2025 19:10
Comment on lines 62 to 68

@include media.min(lg) {
// targets the right links and language switch to hide them on scroll
&:nth-child(2) {
transform: scale(calc(35 / max(var(--header-scroll-top), 35)));
}
}
Copy link
Member

Choose a reason for hiding this comment

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

This is a good idea, but it leaves us with the issue that the controls are still focusable. Earlier, I was thinking that we should not make them focusable by hiding them with display: none, but that leaves us with the issue that we don't know what to do with these controls when they are only partially visible.

I think a better idea would be to only apply the sticky behaviour when the focus is not inside the global navigation. When the page is scrolled, header is sticky, and the user navigates to the language switch via keyboard, we should show the header in full to make sure everything is properly visible. I think that could be done through CSS alone, making it more reliable.

.global-nav:focus-within {
  // Reset all sticky styles
}

// Or the opposite
.global-nav:not(:focus-within) {
  // Sticky styles
}

@leagrdv leagrdv requested a review from gfellerph February 25, 2025 15:11
@leagrdv leagrdv linked an issue Feb 26, 2025 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Header Everything related to our composible header components
Projects
None yet
4 participants