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

feat(internet-header): expose CSS custom properties #3200

Merged
merged 5 commits into from
Jul 11, 2024

Conversation

alizedebray
Copy link
Contributor

No description provided.

@alizedebray alizedebray linked an issue Jul 1, 2024 that may be closed by this pull request
Copy link

changeset-bot bot commented Jul 1, 2024

🦋 Changeset detected

Latest commit: bd68e7b

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

This PR includes changesets to release 3 packages
Name Type
@swisspost/internet-header Minor
@swisspost/design-system-documentation Minor
@swisspost/design-system-nextjs-integration 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

@swisspost-bot
Copy link
Contributor

swisspost-bot commented Jul 1, 2024

Related Previews

Copy link
Member

@gfellerph gfellerph left a comment

Choose a reason for hiding this comment

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

@alizedebray I think this is the way to go. Are the global styles delivered via JS or do the projects have to import an additional CSS file?

@alizedebray
Copy link
Contributor Author

alizedebray commented Jul 1, 2024

@alizedebray I think this is the way to go. Are the global styles delivered via JS or do the projects have to import an additional CSS file?

@gfellerph global styles have to be added manually by the consumers. This is why I declared the variables both on the :root and on the :host, this way you only have to import the global styles if you need to use the custom variables. What do you think?

The main drawback with this approach (apart from duplication) is that is makes the header height customizable... Otherwise we could expose the SCSS variables but then it is no longer framework agnostic.

@alizedebray alizedebray force-pushed the 3194-internet-header-expose-css-custom-properties branch from bc9a05a to a03c6be Compare July 1, 2024 14:52
@alizedebray alizedebray self-assigned this Jul 2, 2024
@gfellerph
Copy link
Member

@gfellerph global styles have to be added manually by the consumers. This is why I declared the variables both on the :root and on the :host, this way you only have to import the global styles if you need to use the custom variables. What do you think?

That's perfect. Can you please add documentation how to do that?

The main drawback with this approach (apart from duplication) is that is makes the header height customizable... Otherwise we could expose the SCSS variables but then it is no longer framework agnostic.

I think that's negligible. If you want to break the header, there are a thousand ways to do so. Setting this variable by mistake is an easy fix.

@alizedebray alizedebray marked this pull request as ready for review July 2, 2024 10:59
@alizedebray alizedebray requested a review from a team as a code owner July 2, 2024 10:59
@alizedebray
Copy link
Contributor Author

alizedebray commented Jul 2, 2024

Can you please add documentation how to do that?

@gfellerph Sure, I added the documentation this morning: https://preview-3200--swisspost-design-system-next.netlify.app/?path=/docs/bfdf4e7c-37d3-40f8-a5d0-734f3e6612b5--docs

Copy link
Member

@gfellerph gfellerph left a comment

Choose a reason for hiding this comment

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

Good work!

.changeset/flat-gifts-report.md Outdated Show resolved Hide resolved
Copy link

sonarcloud bot commented Jul 11, 2024

@alizedebray alizedebray merged commit cf081ce into main Jul 11, 2024
9 checks passed
@alizedebray alizedebray deleted the 3194-internet-header-expose-css-custom-properties branch July 11, 2024 09:37
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.

Internet Header: Expose CSS custom properties
3 participants