bit
bit copied to clipboard
Tailwindcss style won't work in nextjs project (Please help)
Description
I try to use my bit component in next.js project, but the style is not working.
this is what I do:
- create a bit component with tailwindcss | here
- publish to bit.cloud (it's working properly on the cloud)
- set a scoped using NPM registry
- install the component with yarn
yarn add @scope/component@version
- 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
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: [],
}
issue abandoned by the reporter. closing.