teambit / react-tailwind-env

An example of a custom react env with basic support for tailwindcss
9 stars 7 forks source link

It's not working when exporting(deployed on Bit.dev) #14

Open aandriamanga opened 2 years ago

aandriamanga commented 2 years ago

Hi, tailwind classes is work correctly on local but when I export my component on Bit classes is not recognize (any tailwind css). This issue is present after changing "defaultScope" to my scope. Thanks

LeugimAtreides commented 2 years ago

Hi, tailwind classes is work correctly on local but when I export my component on Bit classes is not recognize (any tailwind css). This issue is present after changing "defaultScope" to my scope. Thanks

Yeah super disappointing after all the work to get it exported and how nice it was looking in the local env.

donovanroubos commented 2 years ago

Currently running into the same issue with the team. Any updates?

aliansyahFirdaus commented 1 year ago

ah! @aandriamanga

I realized that the issue stemmed from not including node_modules/@your-bit-org in the content section of the Tailwind CSS configuration. Adding this directory is crucial for correctly applying styling classes from Bit.dev components in the React project.

after install your package into react projec, check your location of components in node_modules and add this to your tailwind config

/** tailwind.config.js (in your react project) **/

export default {
  content: [
    './**/*.{jsx,tsx}',
    './node_modules/@your/components.**/*.{jsx,tsx}', //add this
  ],
  theme: {
    extend: {},
  },
  variants: {},
  plugins: [],
};