Skip to content

Conversation

leagrdv
Copy link
Contributor

@leagrdv leagrdv commented Sep 4, 2025

📄 Description

Temporarily disabled the automatic dark scheme based on the user's preferred color scheme.

@leagrdv leagrdv requested a review from a team as a code owner September 4, 2025 13:22
@leagrdv leagrdv requested a review from alizedebray September 4, 2025 13:22
@leagrdv leagrdv linked an issue Sep 4, 2025 that may be closed by this pull request
4 tasks
Copy link

changeset-bot bot commented Sep 4, 2025

🦋 Changeset detected

Latest commit: 59ae3f7

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

This PR includes changesets to release 12 packages
Name Type
@swisspost/design-system-styles Patch
@swisspost/design-system-components-angular-workspace Patch
@swisspost/design-system-components Patch
@swisspost/design-system-documentation Patch
@swisspost/internet-header Patch
@swisspost/design-system-nextjs-integration Patch
@swisspost/design-system-styles-primeng-workspace Patch
@swisspost/design-system-styles-primeng Patch
@swisspost/design-system-components-react Patch
@swisspost/design-system-components-angular 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

@swisspost-bot
Copy link
Contributor

swisspost-bot commented Sep 4, 2025

Related Previews

@leagrdv leagrdv requested review from oliverschuerch and removed request for alizedebray September 11, 2025 07:52
Copy link
Contributor

@oliverschuerch oliverschuerch left a comment

Choose a reason for hiding this comment

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

Do you really want to keep the changes in the styles playground?
Imo, they where only there for testing reasons, but we should revert them now.

Instead we should remove the data-color-scheme="light" attribute on the html tag in the docs (see preview-body.html). Because this was the "old" way to ensure, the docs always were renderd in light mode and would need to be removed as soon as the dark mode is ready anyway.

@leagrdv
Copy link
Contributor Author

leagrdv commented Sep 11, 2025

Do you really want to keep the changes in the styles playground? Imo, they where only there for testing reasons, but we should revert them now.

Instead we should remove the data-color-scheme="light" attribute on the html tag in the docs (see preview-body.html). Because this was the "old" way to ensure, the docs always were renderd in light mode and would need to be removed as soon as the dark mode is ready anyway.

I intentionally put the changes in the styles playground so that we can test components when they don't have a data-color-scheme on a parent, as we had found a bug recently with this issue

Also, removing the data-color-scheme on the preview-body breaks all of the tests of the palette as it's needed to test the palettes on the different data-color-scheme. Since storybook is not in dark mode anyway, I think we can leave it there for now and tackle it if we ever do a dark mode documentation.

@leagrdv leagrdv requested a review from a team as a code owner September 11, 2025 11:16
Copy link
Contributor

@oliverschuerch oliverschuerch left a comment

Choose a reason for hiding this comment

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

In Chrome 122 (which should use the fallback)
with perfers-color-scheme: dark
and absolutely no data-color-scheme attribute anywhere,
it still uses the dark tokens.

image

It seems to come from the color-scheme.set() mixin, which is still setting color-scheme and --post-fallback-perfers-light to whatever is sent along as a parameter (e.g. $scheme-token) and is used in the palettes, post-banner and card component. .
So the solution should be to hardcode the two values there as well, similar to how we do it in the schemes-static.scss.

image

Copy link

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.

Temporarily disable automatic dark scheme
3 participants