Nativewind classes being removed with Storybook #32332
Unanswered
ethan-krich
asked this question in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I am using nativewind for a UI library I am working on. I am using Storybook for React Native web with Vite as the bundler. The problem is my styles are not applying. Not the tailwind variables or the default ones. However, the same configuration works fine with expo even on the web.
Here is my tailwind.config.js file:
My
global.css
file:Then for storybook I have the following config:
Finally my
preview.ts
:The issue is not tailwind generating the classes. As my output file does have the correct classes in it my I did a test. Additionally, the stylesheet does load in the head with the correct styles yet they do not apply.
[![Styles load][1]][1]
However, the elements themselves do not seem to have the correct classes. So it seems babel is stripping away my tailwind classes. How do I prevent this?
Beta Was this translation helpful? Give feedback.
All reactions