Open avishkakavindu opened 4 months ago
The best way to style any flowbite-react
component is by passing className
(which usually directs the prop to the root element of the component) and if the component has multiple internals/slots, use the theme
prop.
In the docs each element has a theme section which u can follow and see what tailwind classes have been applied in order to style it.
@SutuSebastian I tried to use custom CSS classes that include @apply
rules too but they failed to override default styles. So I used the theme
prop instead, but this way I have to set styles like colour for each component by using theme styles. Is there a way to set the primary colour globally, the default colour is cyan
.
An improved design system config is coming up, there's a lot of work involved and u'll be able to simply set a primary
color in the tailwind.config.js
file and it will apply in all components.
Will that be backwards compatible?
Will that be backwards compatible?
I'll try to keep as much as I can from the old API.
@SutuSebastian btw is the library stable enough to use in production-grade applications, or do we have to wait for the official release?
Best option would be to wait for v1.
Steps to reproduce
navBar.scss
!important
and recheckCurrent behavior
In the
flowbite-react
library, the default styles for the Navbar component are proving difficult to override. Specifically, the styles for theNavbar.Link
elements cannot be customized as expected.Active Link Styling: When attempting to apply custom styles to the active link using the BEM convention and SCSS, the styles do not take effect unless !important is used, the applied styles do not reflect as expected.
Usage of @apply: Tailwind CSS's @apply directive is used in the SCSS to apply utility classes for hover and active states, but these are not being applied correctly due to the specificity or !important styles in Flowbite’s CSS.
Inline Styles as a Last Resort: This doesn't work either
Expected behavior