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]: #663

Open
aaronm-git opened this issue Feb 21, 2024 · 1 comment
Open

[tailwindcss]: #663

aaronm-git opened this issue Feb 21, 2024 · 1 comment
Assignees

Comments

@aaronm-git
Copy link

aaronm-git commented Feb 21, 2024

Details

Recipe Page: tailwindcss
Recipe Template: tailwindcss

What is wrong

You MUST add this to the tailwind config in NEXTjs 14 with tailwind implementation:

/** @type {import('tailwindcss').Config} */
module.exports = {
  content: [
    "./pages/**/*.{js,ts,jsx,tsx}",
    "./components/**/*.{js,ts,jsx,tsx}",
    "./app/**/*.{js,ts,jsx,tsx}",
    "./stories/**/*.{js,ts,jsx,tsx}", // Here!
  ],
  theme: {
    extend: {
      backgroundImage: {
        "gradient-radial": "radial-gradient(var(--tw-gradient-stops))",
        "gradient-conic":
          "conic-gradient(from 180deg at 50% 50%, var(--tw-gradient-stops))",
      },
    },
  },
  plugins: [],
};

otherwise tailwind will NOT work in storybook. Took me 2 days to figure this out. Almost stopped trying to use Storybook.

@domyen
Copy link
Member

domyen commented Feb 26, 2024

Thanks for the report @aaronm-git!

Just to confirm, you added "./stories/**/*.{js,ts,jsx,tsx}" to the tailwind.config.js file?

I'm not super familiar with Tailwind myself, could you tell me a bit about why that line is needed. Story files don't typically have CSS in them. They import the component itself (which has CSS). So I wouldn't think to have Tailwind look at story files. (I'm probably missing something though!)

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

3 participants