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

data-ds-color-mode="auto" no longer works in storybook #2690

Closed
Barsnes opened this issue Oct 25, 2024 · 2 comments · Fixed by #2689
Closed

data-ds-color-mode="auto" no longer works in storybook #2690

Barsnes opened this issue Oct 25, 2024 · 2 comments · Fixed by #2689
Labels
🐛 bug Something isn't working css @digdir/designsystemet-css 📔 storybook storybook.designsystemet.no

Comments

@Barsnes
Copy link
Member

Barsnes commented Oct 25, 2024

This seems to only be an issue storybook.
This is me checking my color-scheme when in storybook:
image

This is on any other page:
image

It seems like this is caused by us setting color-scheme: light on :root

@Barsnes Barsnes changed the title data-ds-color-mode="auto" no longer works data-ds-color-mode="auto" no longer works in storybook Oct 25, 2024
@Barsnes Barsnes added 🐛 bug Something isn't working css @digdir/designsystemet-css labels Oct 25, 2024
@mimarz
Copy link
Collaborator

mimarz commented Oct 28, 2024

I suspect it has to do with Storybook using iframe for its docs/stories thats messing with getting the correct prefers-color-scheme? 🤔

@mimarz
Copy link
Collaborator

mimarz commented Oct 28, 2024

This was fixed by adding a custom ident to iframes inside Storybook, color-scheme: auto;

@mimarz mimarz closed this as completed in 35049eb Oct 30, 2024
@github-project-automation github-project-automation bot moved this from 📄 Todo to ✅ Done in Team Design System Oct 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working css @digdir/designsystemet-css 📔 storybook storybook.designsystemet.no
Projects
Status: ✅ Done
Development

Successfully merging a pull request may close this issue.

2 participants