Hear Ye, Hear Ye! A Call for Aid in the Realm of Codecraft: The Tale of the Missing Styles

Hello everyone, I'm working on creating an NPM package using Vite with React in library mode. I've configured Tailwind CSS in the package and added a few custom CSS classes. Everything seems to work fine when I run the project locally. However, when I publish the NPM package and install it in a new project, I run into an issue. The styles defined in the tailwind.css file are applied correctly to the components. But the Tailwind classes used directly within my SpaceButton.tsx component are not working at all. Here's what I've noticed: Styles in tailwind.css: These styles are correctly applied when I use the component in a new project. Tailwind classes in SpaceButton.tsx: These classes do not apply when the component is used in a new project. Please refer to this post for more detail: https://dev.to/jonkerkoorts/hear-ye-hear-ye-a-call-for-aid-in-the-realm-of-codecraft-the-tale-of-the-missing-styles-1cpj
DEV Community
Hear Ye, Hear Ye! A Call for Aid in the Realm of Codecraft: The Tal...
For the plain English reader: Hello everyone, I'm working on creating an NPM package using Vite...
0 Replies
No replies yetBe the first to reply to this messageJoin