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

TailwindCSS Recipe Missing Info #270

Open
marlatte opened this issue Mar 10, 2025 · 0 comments
Open

TailwindCSS Recipe Missing Info #270

marlatte opened this issue Mar 10, 2025 · 0 comments

Comments

@marlatte
Copy link

I recently added Storybook to my Next.js app, and even after following the this recipe and it's YouTube counterpart, my stories were only picking up some styling from Tailwind, nor was HMR working. I eventually found the answer, and I would love to add it to the recipe so future users don't face the same frustration.

The solution wasn't in my Storybook config files, but my tailwind.config.ts. Nonetheless, I think it's worth adding a line to the recipe since it's an integration guide, not just Storybook docs.

The problem was that the stories/ directory created by npm create storybook@latest fell outside the folders where Tailwind was looking for content (in my case, the Next.js app/ directory). I think it would be very helpful to add a step to the recipe. I'm happy to open the PR myself.


x.x Provide Stories to Tailwind

Depending on your project's structure, the stories/ directory may be outside the rest of your app. Make sure your stories are listed inside your Tailwind config's content array.

// tailwind.config.js

export default {
  content: [
    './src/**/*.{js,ts,jsx,tsx,mdx}', // your project's other code
    './path/to/stories/**/*.{js,ts,jsx,tsx,mdx}',
  ],
// other config settings
}

I think the best place for this is making it either 2.2 after Angular, or just make it step 3 and push the theme-switcher to step 4.

Also, if the wording could be clearer, I can change it as needed.

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

No branches or pull requests

1 participant