renatomoor / storybook-tailwind-dark-mode

MIT License
20 stars 16 forks source link

On a build folder, the tailwind styles are not getting applied to files inside .storybook folder #5

Open jayaramkasi opened 2 years ago

jayaramkasi commented 2 years ago

Working fine in dev

The issue After running npm run build-storybook, and serving the folder locally start-storybook -s storybook-static, tailwind's dark mode is not getting applied in the .storybook folder. Works fine for the components inside the src/ folder though

** The code structure I have a Layout.js file where all my page styles are applied including dark mode. This is passed inside preview.js as a prop to addDecorator.

Layout.js also imports a styles.css file, applying styles here seems to be working. However, inline classNames in Layout.js doesn't seem to be working.

Content of Layout.js

export default Layout = ({ children }) => (
  <div className="p-0 md:p-4 dark:bg-gray-800 text-gray-900 dark:text-gray-50 max-w-full">
    {children}
  </div>
);
stephyswe commented 2 years ago

Tailwind styles are applied here. But dark mode doesn't work in build mode. Is there any troubleshooting on this issue?

jayaramkasi commented 2 years ago

My bad. That's what I meant.

Code repository: https://github.com/Pikkol/wolffia-ui