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

Following phx.gen.storybook Instructions Breaks All CSS on Pages #419

Closed
probably-not opened this issue Jan 30, 2024 · 2 comments · Fixed by #423
Closed

Following phx.gen.storybook Instructions Breaks All CSS on Pages #419

probably-not opened this issue Jan 30, 2024 · 2 comments · Fixed by #423
Assignees
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@probably-not
Copy link

After initializing an empty Phoenix project, I added phoenix_storybook so that I can showcase the components in our app.

I ran phx.gen.storybook and followed the exact instructions given, and when simply opening the default homepage of the Phoenix app, I see that all of the CSS is broken on the page...

The root cause seems to be the instruction in phx.gen.storybook telling me to add important: ".demo-web", to my module.exports in my tailwind.config.js file. Removing that configuration fixes the CSS issues on the page, and doesn't seem to affect my storybook components at all.

I've created a recreation of the exact steps I took here: https://github.com/probably-not/storybook-css-break-issue

@cblavier cblavier self-assigned this Feb 6, 2024
@cblavier
Copy link
Contributor

cblavier commented Feb 6, 2024

thanks, I'll have a look on your repo

@cblavier cblavier added bug Something isn't working good first issue Good for newcomers labels Feb 6, 2024
@cblavier
Copy link
Contributor

cblavier commented Feb 6, 2024

the good way to solve this issue is to add the storybook-css-break-issue-web CSS class to your body tag in root.html.heex

I guess I need to add this instruction to the generator

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants