Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
764cda4
feat(components): update header spacing
alizedebray Oct 21, 2025
f9528bb
fix linting
alizedebray Oct 23, 2025
68a4004
Merge branch 'main' into header-spacing-3
alizedebray Oct 23, 2025
eafe7d8
fix e2e
alizedebray Oct 23, 2025
b06df24
remove icon text on mobile and tablet
alizedebray Oct 24, 2025
fd8b01d
Remove labels also in the local header on mobile
alizedebray Oct 24, 2025
afac68b
Stop local header from showing on mobile when header button is focused
alizedebray Oct 24, 2025
fee66a1
Improve padding and gap on mobile with long titles
alizedebray Oct 24, 2025
f03168b
Fix "rubber band" scrolling effect
alizedebray Oct 24, 2025
4eb76ab
Fix flickering
alizedebray Oct 27, 2025
c58c8ab
Fix main navigation flash
alizedebray Oct 27, 2025
522d30f
Fix burger subnavigation scrollbar
alizedebray Oct 27, 2025
d04cdd2
Merge branch 'main' into header-spacing-3
alizedebray Oct 27, 2025
7ade654
Fix linting
alizedebray Oct 27, 2025
491c8b6
Merge remote-tracking branch 'origin/header-spacing-3' into header-spโ€ฆ
alizedebray Oct 27, 2025
2194c33
Fix e2e tests
alizedebray Oct 27, 2025
2c62661
Merge branch 'main' into header-spacing-3
alizedebray Oct 27, 2025
c347984
Fix burger menu position
alizedebray Oct 27, 2025
660848e
Simplify custom properties
alizedebray Oct 27, 2025
a37dde9
Fix burger menu animation on Safari
alizedebray Oct 27, 2025
0006396
rename "custom controls" to "local controls"
alizedebray Oct 28, 2025
5ef3743
Merge remote-tracking branch 'origin/main' into header-spacing-3
alizedebray Oct 28, 2025
041d236
remove "Authorities" target group
alizedebray Oct 28, 2025
569b782
fix misaligned avatar
alizedebray Oct 29, 2025
76839e7
fix focus
alizedebray Oct 29, 2025
c771edc
fix linting
alizedebray Oct 29, 2025
7fa8d1c
fix burger menu
alizedebray Oct 29, 2025
b801246
Merge branch 'main' into header-spacing-3
alizedebray Oct 29, 2025
6eec852
fix megadropdown shadow
alizedebray Oct 29, 2025
60e7840
Merge branch 'main' into header-spacing-3
alizedebray Oct 29, 2025
fbd6f6c
Fix alignment on mobile
alizedebray Oct 29, 2025
49f5540
fix(components): update outline offset of focused elements
leagrdv Nov 3, 2025
b6aa47c
Update main navigation to allow for visible outlines
leagrdv Nov 4, 2025
056438e
fix zindex
leagrdv Nov 6, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/early-news-fetch.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@swisspost/design-system-components': major
---

Renamed the `toggleMobileMenu` method in the `post-header` component to `toggleBurgerMenu` for clearer and device-agnostic naming.
7 changes: 7 additions & 0 deletions .changeset/good-walls-cheer.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
'@swisspost/design-system-components': major
'@swisspost/design-system-documentation': patch
---

Removed the default slot from the `post-header` component.
Content previously placed in the default slot should now be assigned to the `local-controls` slot.
7 changes: 7 additions & 0 deletions .changeset/quiet-flies-lie.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
'@swisspost/design-system-components': major
'@swisspost/design-system-documentation': patch
---

Removed the `slot` attribute from the `post-mainnavigation` host.
The slot must now be added manually to position the `post-mainnavigation` correctly within the `post-header` component.
5 changes: 5 additions & 0 deletions .changeset/shaky-cups-bake.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@swisspost/design-system-components': major
---

Removed `--post-local-header-top` custom properties from the `post-header` component because the local header is no longer a positioned element.
5 changes: 5 additions & 0 deletions .changeset/tricky-wombats-rest.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@swisspost/design-system-components': patch
---

Corrected offset of the outline of focused elements in the `post-language-option` and `post-mainnavigation`.
16 changes: 8 additions & 8 deletions packages/components/cypress/e2e/header.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ describe('Header', () => {
};

it('should close mobile nav menu after reattaching header', () => {
cy.get('div.local-header-mobile-extended').should('not.exist');
cy.get('div.burger-menu.extended').should('not.exist');
cy.get('post-togglebutton').click();
cy.get('div.local-header-mobile-extended').should('exist');
cy.get('div.burger-menu.extended').should('exist');

removeAndReattachHeader();

cy.get('div.local-header-mobile-extended').should('not.exist');
cy.get('div.burger-menu.extended').should('not.exist');
});

it('should release scroll lock after reattaching header', () => {
Expand All @@ -40,31 +40,31 @@ describe('Header', () => {
it('should close both megadropdown and mobile menu with one click', () => {
// Open mobile menu
cy.get('post-togglebutton').click();
cy.get('div.local-header-mobile-extended').should('exist');
cy.get('div.burger-menu.extended').should('exist');
// Open megadropdown
cy.get('post-megadropdown-trigger').first().click();
cy.get('post-megadropdown .megadropdown-container').should('be.visible');
// Click menu button to close both
cy.get('post-togglebutton').click();
cy.get('div.local-header-mobile-extended').should('not.exist');
cy.get('div.burger-menu.extended').should('not.exist');
cy.get('post-megadropdown .megadropdown-container').should('not.be.visible');
});

it('should animate megadropdown open after forced close', () => {
// Open mobile menu and megadropdown
cy.get('post-togglebutton').click();
cy.get('div.local-header-mobile-extended').should('exist');
cy.get('div.burger-menu.extended').should('exist');
cy.get('post-megadropdown-trigger').first().should('be.visible').click();
cy.get('post-megadropdown .megadropdown-container').should('be.visible');

// Force close by toggling menu
cy.get('post-togglebutton').click();
cy.get('div.local-header-mobile-extended').should('not.exist');
cy.get('div.burger-menu.extended').should('not.exist');
cy.get('post-megadropdown .megadropdown-container').should('not.be.visible');

// Reopen mobile menu before clicking the trigger again
cy.get('post-togglebutton').click();
cy.get('div.local-header-mobile-extended').should('exist');
cy.get('div.burger-menu.extended').should('exist');
cy.get('post-megadropdown-trigger').first().should('be.visible').click();

// Check if animation class is present
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
<h1 slot="title">Application title</h1>

<!-- Custom content (optional) -->
<ul class="list-inline">
<ul slot="local-controls" class="list-inline">
<li>
<a href="#">
<span>Search</span>
Expand All @@ -62,7 +62,7 @@ <h1 slot="title">Application title</h1>
</ul>

<!-- Main navigation -->
<post-mainnavigation caption="Hauptnavigation">
<post-mainnavigation slot="post-mainnavigation" caption="Hauptnavigation">
<post-list title-hidden="">
<h2>Main Navigation</h2>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
<h1 slot="title">Application title</h1>

<!-- Custom content (optional) -->
<ul class="list-inline">
<ul slot="local-controls" class="list-inline">
<li>
<a href="#">
<span>Search</span>
Expand All @@ -62,7 +62,7 @@ <h1 slot="title">Application title</h1>
</ul>

<!-- Main navigation -->
<post-mainnavigation caption="Hauptnavigation">
<post-mainnavigation slot="post-mainnavigation" caption="Hauptnavigation">
<post-list title-hidden="">
<h2>Main Navigation</h2>

Expand Down
4 changes: 2 additions & 2 deletions packages/components/src/components.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -202,9 +202,9 @@ export namespace Components {
}
interface PostHeader {
/**
* Toggles the mobile navigation.
* Toggles the burger navigation menu.
*/
"toggleMobileMenu": (force?: boolean) => Promise<void>;
"toggleBurgerMenu": (force?: boolean) => Promise<void>;
}
/**
* @class PostIcon - representing a stencil component
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ img,
justify-content: center;
align-items: center;
position: relative;
z-index: 2;
width: 100%;
height: 100%;
background-color: var(--post-avatar-bg);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
@use '@swisspost/design-system-styles/mixins/media';

:host {
// The following variables will affect the header to minimize it on scroll
--post-global-header-top: calc(var(--post-global-header-reduced-height) - var(--post-global-header-expanded-height));
--post-header-top: calc(var(--post-header-reduced-height) - var(--post-header-expanded-height));

--post-logo-height: calc(var(--post-global-header-expanded-height) - var(--post-header-scroll-top, 0px));
--post-global-controls-top: clamp(
/* 0 when header is static, large negative when header shrinks to enable offset */
1000 * (var(--post-global-header-reduced-height) - var(--post-global-header-expanded-height)),
calc(-1 * min(var(--post-header-scroll-top, 0px) / 4, var(--post-global-header-reduced-height))),
0px
);

@include media.only(desktop) {
--post-header-gap: 0.25rem;
--post-global-header-padding-inline-start: 0.25rem;
--post-global-header-padding-inline-end: 0.5rem;
--post-local-header-padding-inline-start: 0.75rem;
--post-local-header-padding-inline-end: 0.5rem;
}

@include media.only(tablet) {
--post-header-gap: 0.75rem 0.25rem;
--post-global-header-padding-inline-start: 0.25rem;
--post-global-header-padding-inline-end: 0.25rem;
--post-local-header-padding-inline-start: 0.75rem;
--post-local-header-padding-inline-end: 0.25rem;
--post-local-header-padding-block: 0.75rem;
--post-burger-menu-padding-inline: 2.5rem;
--post-burger-menu-body-gap: 2rem;
--post-burger-menu-footer-gap: 1.5rem;
}

// this is being discussed in Figma
@include media.only(sm) {
--post-burger-menu-padding-inline: 1rem;
}

@include media.only(mobile) {
--post-header-gap: 0.75rem 0.25rem;
--post-global-header-padding-inline-start: 0rem;
--post-global-header-padding-inline-end: 0.5rem;
--post-local-header-padding-inline-start: 0.5rem;
--post-local-header-padding-inline-end: 0.5rem;
--post-local-header-padding-block: 0.75rem;
--post-burger-menu-padding-inline: 1rem;
--post-burger-menu-body-gap: 1.5rem;
--post-burger-menu-footer-gap: 1rem;
}
}

:host([data-expanded]) {
--post-header-top: 0;
--post-global-header-top: 0;
--post-global-controls-top: 0;
--post-logo-height: var(--post-global-header-expanded-height);
}
Loading
Loading