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

Fix and investigate layers not working correctly in Storybook #2311

Open
JoCa96 opened this issue Dec 11, 2024 · 1 comment
Open

Fix and investigate layers not working correctly in Storybook #2311

JoCa96 opened this issue Dec 11, 2024 · 1 comment
Labels
bug Something isn't working or not shown correctly dev Requires technical expertise storybook Storybook improve- or adjustments
Milestone

Comments

@JoCa96
Copy link
Collaborator

JoCa96 commented Dec 11, 2024

Why?

#2310 is a temp fix, but we need to figure out whats going on:

Broken components in Storybook
dev Currently many components styles are broken in our prod Storybook. Its propably caused by the normalization change but it works when running the Storybook locally and also for the Playwright screenshots.

Do you have any idea whats going on here? I remember that we had some weird issues with the CSS layers not being in the correct order in the deployed Storybook

Correct layers (when running pnpm dev):

Somehow broken layers when deploying Storybook:

Can be reproduced locally by running "pnpm build:storybook && pnpm preview"

That probably means that the order in which the css is parsed, changed

The css layer order is determined by whatever happens first:
Either a plain @layer declaration with the order of the declarations
or the order in which the layers are used

When searching in the DOM, it seems like the layers definition is missing completely, in the local Storybook you can find it in the DOM <style> tags

@JoCa96 JoCa96 added the dev Requires technical expertise label Dec 11, 2024
@JoCa96 JoCa96 added this to onyx Dec 11, 2024
@github-project-automation github-project-automation bot moved this to New in onyx Dec 11, 2024
@JoCa96 JoCa96 self-assigned this Dec 13, 2024
@JoCa96 JoCa96 moved this from New to In Approval in onyx Dec 13, 2024
@JoCa96
Copy link
Collaborator Author

JoCa96 commented Dec 13, 2024

There is an open issue in Vite, regarding CSS ordering (See: vitejs/vite#3924)
This seems to be the root cause.

@mj-hof mj-hof added this to the Product improvements milestone Dec 13, 2024
@mj-hof mj-hof added bug Something isn't working or not shown correctly and removed bug Something isn't working or not shown correctly labels Dec 13, 2024
@mj-hof mj-hof added the storybook Storybook improve- or adjustments label Dec 16, 2024
@JoCa96 JoCa96 removed their assignment Jan 10, 2025
@JoCa96 JoCa96 moved this from In Approval to Backlog in onyx Jan 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working or not shown correctly dev Requires technical expertise storybook Storybook improve- or adjustments
Projects
Status: Backlog
Development

Successfully merging a pull request may close this issue.

2 participants