-
-
Notifications
You must be signed in to change notification settings - Fork 430
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
className doesn't override existing Tailwind classes in Navbar component #630
Comments
Hi there, you can either use a theme as described in the README to overwrite the Navbar theme and replace the background color class, or use !important via Tailwind CSS - !bg-X. |
Whilst using
None of the types associated with these properties reference anything to do with styling. |
@DarrenRED take a look into this PR #800 and here: https://www.flowbite-react.com/docs/customize/theme |
@DarrenRED Hi there - you are indeed correct that In short, we redirected all of the Tailwind CSS classes applied to each Flowbite React component into the theme whose TS typing you printed in your comment. That means you can pass a custom theme to replace Tailwind CSS classes, using a |
Hi @tulup-conner, yes since writing my last comment I've worked out how to leverage the For example..
Turns out to modify the actual classes of the I think it'd be good to document the theme prop in full to avoid others frustration in the future. There are still some undocumented props in the above example that I do not know what they do, that may be useful. E.g. Our team purchased Flowbite to bang out a project with speed in mind and I've spent quite a lot of time banging my head against simple CSS issues and I think this is really just a documentation issue. |
Yep, we are well aware it is a documentation issue and are actively trying to solve it. All the frustrations you have had are the same ones I and everyone else using the software has run into at some point. Design systems are complicated :) Unfortunately, there isn't a simple and straightforward way to systemically document the purpose of each theme key, but we're brainstorming #808 |
Describe the bug
When trying to give the
Navbar
component abg-black
Tailwind class via theclassName
prop, nothing happens. The class is getting applied to the component, but thebg-black
class is not overriding the exisitingbg-white
class already on the component. This is unintuitive as classes supplied viaclassName
should change the styling of the component.To Reproduce
Create a Navbar component with a
className
ofbg-black
:<Navbar className="bg-black">
. The background color of the Navbar doesn't change to black as expected.Screenshots
Project information:
The text was updated successfully, but these errors were encountered: