Loading Tailwind config into Storybook in a monorepo structure #25412
Replies: 6 comments
-
I tried using a tailwind preset but still the same problem |
Beta Was this translation helpful? Give feedback.
-
This issue might be related to it #19041 |
Beta Was this translation helpful? Give feedback.
-
This issue might also be related to it #20616 |
Beta Was this translation helpful? Give feedback.
-
This issue #15971 could also be related although a few years old |
Beta Was this translation helpful? Give feedback.
-
Having the same issue. did you find a way to make it work? |
Beta Was this translation helpful? Give feedback.
-
Here is a "dirty" workaround : |--- packages
|------ my-beautiful-component-with-vue
|------ my-other-component
|------ storybook
|------------ tailwind.config.ts (symlink)
|------------ postcss.config.js (symlink)
|--- tailwind.config.ts
|--- postcss.config.js
ln -s ../../tailwind.config.ts ../tailwind.config.ts
ln -s ../../postcss.config.js ../postcss.config.js
import type { Config } from "tailwindcss";
const packagesPath = new URL(".", import.meta.url).pathname;
export default {
content: [`${packagesPath}/**/*.{vue,js,ts,jsx,tsx}`, "!./node_modules/**"],
theme: {},
plugins: [],
} satisfies Config; Not the best way to do, but at least, storybook works x) |
Beta Was this translation helpful? Give feedback.
-
Summary
Hi all,
My team is migrating our UI kit library to a monorepo structure (here)
The current structure of the mono repo as like this:
I'm testing around and when I change
--radius
in/packages/components/styles.css
the border-radius changes in the components displayed in the storybooks, which is a good sign. But there are other things from the tailwind config not working inside storybook, the ones I can tell are:Is this possibly a tailwind issue or a storybook issue?
Any help is appreciated 🌹
Additional information
The
packages/storybook/.storybook/main.ts
is:Create a reproduction
https://github.com/sikka-software/Hawa/tree/monorepo
Beta Was this translation helpful? Give feedback.
All reactions