-
-
Notifications
You must be signed in to change notification settings - Fork 451
Custom Theme not applying on Flowbite Accordion #1418
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
Comments
yes I also have same issue, on focus for example... |
Hey @Mnehaal2000 , are you using also, for your above code snippet, try below one code snippet: const customFloorAccordionTheme: CustomFlowbiteTheme = {
accordion: {
// your remaining code
}
} or you can have other option as well: const customFloorAccordionTheme: CustomFlowbiteTheme['accordion'] = {
// your remaining code
} either of this code snippet should work, can you try this @Mnehaal2000 |
I am using a combination and I have already tried your suggestion. Nothing seems to work. I am using other custom Themes in the project too using the same method and everything else works except this accordion theme So I am confused. |
I'm encountering the same problem as well. But another solution I tried was to provide the const accordionTheme = {
root: {
base: 'divide-y-2 border-2 divide-gray-200 border-gray-200 dark:divide-gray-600 dark:border-gray-600',
},
content: {
base: 'p-5 first:rounded-t-lg last:rounded-b-lg dark:bg-gray-700',
},
title: {
base: 'flex w-full items-center justify-between p-5 text-left font-medium text-gray-500 first:rounded-t-lg last:rounded-b-lg dark:text-gray-400',
flush: {
off: 'hover:bg-gray-100 focus:ring-4 focus:ring-gray-200 dark:hover:bg-gray-600 dark:focus:ring-gray-600',
on: 'bg-transparent dark:bg-transparent',
},
open: {
off: '',
on: 'bg-gray-100 text-gray-900 dark:bg-gray-600 dark:text-white',
},
},
};
// ...
<Accordion theme={accordionTheme}>
{resourceData.map((resource) => (
<Accordion.Panel theme={accordionTheme}>
<Accordion.Title theme={accordionTheme.title}>
{/* ... */}
</Accordion.Title>
<Accordion.Content theme={accordionTheme.content}>
{/* ... */}
</Accordion.Content>
</Accordion.Panel>
))}
</Accordion> That worked for applying the required styles to the title and content components, but unfortunately the required styles still did not apply for the root accordion component itself. As a workaround, I just applied those remaining styles using |
It works for me, thx :) |
Fixed by #1498 in [email protected] release. Please see Docs - Customize - Theme. |
Current behavior
Custom Theme not applying on Flowbite Accordion
The text was updated successfully, but these errors were encountered: