Skip to content

Conversation

@alizedebray
Copy link
Contributor

@alizedebray alizedebray commented Nov 13, 2025

📄 Description

Update header styles to match the Figma design.
This PR focuses on the post-header, the post-mainnavigation and post-megadropdown will be finalized in another PR.

🚀 Demo

Updated version:

Current version to compare to:


🔮 Design review

  • Design review done
  • No design review needed

📝 Checklist

  • ✅ My code follows the style guidelines of this project
  • 🛠️ I have performed a self-review of my own code
  • 📄 I have made corresponding changes to the documentation
  • ⚠️ My changes generate no new warnings or errors
  • 🧪 I have added tests that prove my fix is effective or that my feature works
  • ✔️ New and existing unit tests pass locally with my changes

@alizedebray alizedebray requested review from a team as code owners November 13, 2025 17:28
@changeset-bot
Copy link

changeset-bot bot commented Nov 13, 2025

🦋 Changeset detected

Latest commit: e3f4ebd

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

This PR includes changesets to release 14 packages
Name Type
@swisspost/design-system-styles Major
@swisspost/design-system-documentation Patch
@swisspost/design-system-components-angular-workspace Major
@swisspost/design-system-components Major
@swisspost/internet-header Major
@swisspost/design-system-nextjs-integration Major
@swisspost/design-system-styles-primeng-workspace Major
@swisspost/design-system-styles-primeng Major
@swisspost/design-system-components-react Major
@swisspost/design-system-components-angular Major
@swisspost/design-system-changelog-github Major
@swisspost/design-system-eslint Major
@swisspost/design-system-icons Major
@swisspost/design-system-tokens Major

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

@swisspost-bot
Copy link
Contributor

swisspost-bot commented Nov 13, 2025

Related Previews

@alizedebray alizedebray force-pushed the header-spacing-2 branch 2 times, most recently from 306d41a to 604452a Compare November 20, 2025 09:18
@sonarqubecloud
Copy link


Updated styles for elements slotted in the `post-header` component.
Slotted lists should now omit the `.list-inline` class and will be automatically styled as part of the `post-header`.
Keeping the `.inline-list` class will cause incorrect spacing between header elements. No newline at end of file
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
Keeping the `.inline-list` class will cause incorrect spacing between header elements.
Keeping the `.list-inline` class will cause incorrect spacing between header elements.

Comment on lines +10 to +11
&:where(a, button, [role='button']),
&:where(ul) > li > :where(a, button, [role='button']) {
Copy link
Contributor

Choose a reason for hiding this comment

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

What do you mean, should we include [role="link"] and/or [tabindex="0"] as well, just to make sure they are styled correctly if developers insert such an element into a slot?

Comment on lines +38 to +41
> post-icon {
width: 1em;
height: 1em;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

This does add properties, that are already defined on the post-icon by default. It only changes the specificity user would need to override the width and height properties.

border: unset;
padding: 0.25rem 0.625rem;
gap: 0.375rem;
line-height: 1.5;
Copy link
Contributor

Choose a reason for hiding this comment

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

line-height: 1.5 is the default on the body element and is never changed in between. Defininig it does not change anything.

I see that you probably added it, to ensure it is defined correctly, in case the button-base mixin should ever define it differently.
However, if this is the only reason for its presence, we could use line-height: unset instead, so it falls back to the line-height defined on the body.

padding: 0.25rem 0.625rem;
gap: 0.375rem;
line-height: 1.5;
font-size: 1rem;
Copy link
Contributor

Choose a reason for hiding this comment

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

While font-size: 1rem might be ok for most of the header links/buttons in the global header, it is currently not working or there is a potential risk for the folloging ones:

  • Links/buttons in post-megadropdown.
    font-size should change between breakpoints.
    Figma Design
  • Links/buttons slotted in flyouts such as the user-menu, etc.
  • Links/buttons slotted in the custom navigation-controls slot.
    Image

gap: 0.375rem;
line-height: 1.5;
font-size: 1rem;
font-weight: 400;
Copy link
Contributor

Choose a reason for hiding this comment

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

font-weight: 400 is the default on the body element and the only reason we need to re-define it here is, because the is set to 700 by the button-base mixin.

I would suggest to do the same thing as with the line-height property. Set font-weight: unset and let it fall back to the default font-weight, defined on the body element, instead of defining an explicit value.

@use '../functions/tokens';
@use '../tokens/components';

tokens.$default-map: components.$post-button;
Copy link
Contributor

Choose a reason for hiding this comment

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

Did you had to do this because of a technical limitation?
e.g. using the mixin in a file which defines the tokens.$default-map variable on its own and therefore overrides the one defined here?

If so, we should do the following things:

  • Create a ticket to remove the tokens.$default-map variable in all mixin files and instead implement the used map in the same way you did it here.
  • Add an ADR on github, which explaines the decision and its necessity.

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.

4 participants