bit icon indicating copy to clipboard operation
bit copied to clipboard

Tailwindcss style won't work in nextjs project (Please help)

Open charismanapriandi opened this issue 1 year ago • 1 comments

Description

I try to use my bit component in next.js project, but the style is not working.

this is what I do:

  1. create a bit component with tailwindcss | here
  2. publish to bit.cloud (it's working properly on the cloud)
  3. set a scoped using NPM registry
  4. install the component with yarn yarn add @scope/component@version
  5. use components in the project

Specifications

  • Bit version: 0.1.74
  • Node version: 19.0.0
  • yarn version: 1.22.19
  • Platform: macOS ventura 13.4
  • Bit compiler (include version): unknown
  • Bit tester (include version): unknown

Context and additional information

// .bitmap { "config/tailwind": { "scope": "charismanapriandi.untitled-ui", "version": "0.0.1", "mainFile": "index.ts", "rootDir": "untitled-ui/config/tailwind" }, "envs/my-react-env": { "scope": "charismanapriandi.untitled-ui", "version": "0.0.1", "mainFile": "index.ts", "rootDir": "untitled-ui/envs/my-react-env" }, "helper/remove-leading-zero": { "scope": "charismanapriandi.untitled-ui", "version": "0.0.1", "mainFile": "index.ts", "rootDir": "untitled-ui/helper/remove-leading-zero" }, "ui/button": { "scope": "charismanapriandi.untitled-ui", "version": "0.0.3", "mainFile": "index.ts", "rootDir": "untitled-ui/ui/button" }, "$schema-version": "15.0.0" }

button dependencies image

charismanapriandi avatar Jul 25 '23 09:07 charismanapriandi

Hi! Do you have the component in the content array of the Tailwind config of your app? Something like this:

/** @type {import('tailwindcss').Config} */
module.exports = {
  content: [
     // other content...
     "./node_modules/@scope/component/**/*.js",
     // you can also search inside an org, "./node_modules/@scope/**/*.js"
  ],
  theme: {
    extend: {},
  },
  plugins: [],
}

nachoaldamav avatar Aug 01 '23 08:08 nachoaldamav

issue abandoned by the reporter. closing.

itaymendel avatar Apr 02 '24 06:04 itaymendel