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

Migrate storybook's assets to Tailwind 4.0 #588

Open
cblavier opened this issue Feb 26, 2025 · 0 comments
Open

Migrate storybook's assets to Tailwind 4.0 #588

cblavier opened this issue Feb 26, 2025 · 0 comments
Assignees
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@cblavier
Copy link
Contributor

cblavier commented Feb 26, 2025

I started working on moving phoenix_storybook to Tailwind 4.0 🤯

First, it's important to mention that the Tailwind version used in the Storybook and the version used in the hosting application are not necessarily correlated. You can bundle your app's CSS with Tailwind 4.0, while the Storybook may generate its assets with Tailwind 3.x

That being said, I'm struggling with Tailwind 4 new layer-based architecture: everything in Tailwind 4.0 is part of a CSS layer. While you can tune the priority of a layer over other layers, unlayered styles will always have higher precedence.

If the hosting application provides a CSS reset/preflight outside of any layer (as in Tailwind 3.x), the reset will overwrite most of the storybook's styling (since unlayered styles are prioritized over Tailwind 4 layers)

The same concern is related here.

So far, my best idea would be to ask storybook's users to wrap their styling within a specific @storybook layer
Do you have any idea, someone?

@cblavier cblavier added enhancement New feature or request help wanted Extra attention is needed labels Feb 26, 2025
@cblavier cblavier self-assigned this Feb 26, 2025
@cblavier cblavier changed the title Migrate storybook's assets to Tailwind 4 Migrate storybook's assets to Tailwind 4.0 Feb 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant