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

chore(components, styles): move header css variables to styles package #4663

Merged
merged 7 commits into from
Feb 19, 2025
Merged
6 changes: 6 additions & 0 deletions .changeset/weak-pears-dance.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@swisspost/design-system-components': patch
'@swisspost/design-system-styles': patch
---

Moved header css variables to the styles package.
Original file line number Diff line number Diff line change
Expand Up @@ -9,32 +9,11 @@
}

:host {
z-index: commons.$zindex-header;
--global-header-height: 72px;
--global-header-minimal-height: 24px;
--local-header-height: 112px;
--local-header-min-height: 56px;
--header-height: calc(var(--global-header-height) + var(--local-header-height));

z-index: 1020;
position: relative;

@include media.min(lg) {
--global-header-reduced-height: 24px;
--main-navigation-height: 56px;
}

@include media.max(lg) {
--global-header-height: 64px;
--local-header-height: 48px;
--local-header-min-height: 48px;
--main-navigation-height: 0px;
}
}

:host(:not(:has([slot='title']))) {
--local-header-height: var(--main-navigation-height);

.local-header {
padding-block-start: 0;
}
Expand Down Expand Up @@ -114,7 +93,7 @@
gap: var(--post-core-dimension-8);
min-height: var(--local-header-min-height);
background: var(--post-core-color-brand-white);
transition: box-shadow 0.2s ease-in-out;
transition: box-shadow 0.2s ease-in-out;

@include media.min(lg) {
z-index: 3;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,8 @@
}

.megadropdown-container {
--post-main-header-height: 56px;
--post-global-header-height: 72px;
--post-header-height: calc(var(--post-global-header-height) + var(--post-main-header-height));
box-shadow: 0 8px 6px rgba(0, 0, 0, 16%);
position: absolute;

background-color: #fafafa;
border: none;
z-index: 1;
Expand All @@ -70,13 +66,12 @@
}

@include media.max(lg) {
--post-global-header-height: 64px;
z-index: 4;
top: 0 !important;
left: 0;
width: 100%;
position: fixed;
height: calc(100vh - var(--post-header-height));
height: calc(100vh - var(--header-height));
max-height: calc(100vh - var(--header-height));
border-top: unset;
overflow: auto;
Expand Down
22 changes: 22 additions & 0 deletions packages/styles/src/components/header/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,28 @@
@use 'mixins' as *;

post-header {
--global-header-height: 72px;
--global-header-minimal-height: 24px;
--local-header-height: 112px;
--local-header-min-height: 56px;
--header-height: calc(var(--global-header-height) + var(--local-header-height));

@include media.min(lg) {
--global-header-reduced-height: 24px;
--main-navigation-height: 56px;
}

@include media.max(lg) {
--global-header-height: 64px;
--local-header-height: 48px;
--local-header-min-height: 48px;
--main-navigation-height: 0px;
}

&:not(:has([slot='title'])) {
--local-header-height: var(--main-navigation-height);
}

ul[slot='meta-navigation'] {
gap: var(--post-core-dimension-4);

Expand Down
Loading