I just started installing NextUI on my existing project which uses styled components to style all of the components. After installing NextUI following the guide, I was able to display Tabs and Table. I encountered a few css issues:
- The color primary is not reflected on the tabs's color, it still shows Blue where as i had configured some green color.
<Tabs
aria-label="Menu"
size="lg"
color="primary"
selectedKey={selectedTab}
onSelectionChange={setSelectedTab}
>
<Tab key="orders" title="Recent Orders">
my tailwind.config.js:
const { nextui } = require("@nextui-org/react");
/** @type {import('tailwindcss').Config} */
module.exports = {
content: [
"./node_modules/@nextui-org/theme/dist/**/*.{js,ts,jsx,tsx}",
"./node_modules/@nextui-org/theme/dist/components/(tabs|table).js",
],
theme: {
extend: {},
},
darkMode: "class",
plugins: [
nextui({
themes: {
light: {
colors: {
background: "#FFFFFF", // or DEFAULT
foreground: "#11181C", // or 50 to 900 DEFAULT
primary: {
//... 50 to 900
foreground: "#FFFFFF",
DEFAULT: "#05CE78", // Some green color, definitely not blue
},
},
},
},
}),
],
};
Strangely, i was able to change foreground color to any color i specify but NOT the DEFAULT color. Changing DEFAULT color had no effect, it continues to display Blue color Tabs..
- User component avatarProps somehow is having 0 opacity without me changing anything:
I can see the image properly once i remove the opacity from
<img class="..">
I have absolutely no clue who added the class value for tailwindcss.
Please help.. I was simply hardcoding things straight from code example. What am i missing here?
I tried reinstalling tailwind, doing all the steps in tailwind guide, i only use simple elements, i also tried Button, same thing, primary color that I specified did not show up (only Blue primary is shown)
Problem :
Possible Cause :
Solution :
Update
content
key in yourtailwind.config.js
to:Please Read :