Skip to content
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

Button's theme={} not applying #663

Closed
Ncookiez opened this issue Mar 13, 2023 · 4 comments
Closed

Button's theme={} not applying #663

Ncookiez opened this issue Mar 13, 2023 · 4 comments
Labels
🐛 bug Something isn't working confirmed This bug was confirmed good first issue Good for newcomers help wanted Extra attention is needed

Comments

@Ncookiez
Copy link
Contributor

Ncookiez commented Mar 13, 2023

Describe the bug
Passing a theme={} to a Button does nothing.

To Reproduce
Steps to reproduce the behavior:

  1. Import Button from package
  2. Pass it a custom theme through theme={}
  3. See no changes

Expected behavior
The custom theme should be applied to the Button.

Project information:

  • Flowbite React: 0.4.2

Additional context
Posting this here to not lose track of it - this was discussed in the Discord last week but I didn't have time to implement it. Will probably get a PR up this week, but if anyone else wants to take this, be my guest.

On Discord, from @rluders :

const theme = mergeDeep(useTheme().theme.button, customTheme);
const groupTheme = mergeDeep(useTheme().theme.buttonGroup, customTheme.inner ?? {});

Splitting the existing useTheme() here to something like the above should do the trick. Needs testing.

@rluders rluders added 🐛 bug Something isn't working help wanted Extra attention is needed good first issue Good for newcomers confirmed This bug was confirmed labels Apr 6, 2023
@SoulThread2597
Copy link

Seems to be an issue to all compoents when they are applied with an individual theme

@Ncookiez
Copy link
Contributor Author

Seems to be an issue to all compoents when they are applied with an individual theme

Most likely not - Only confirmed with Button so far, although some other components are finicky with their children components (you can send root themes to the parent, but it doesn't correctly pass themes to children, etc.).

Am using custom individual themes just fine on my app with the Card, Dropdown, Footer, Modal and Navbar components.

@rluders
Copy link
Collaborator

rluders commented May 15, 2023

I'm wondering if someone is interested in creating a PR for this one. I'll be happy to review it this week, or ASAP. Also, I'm curious if this issue is happening in any other components.

@rluders rluders added the help wanted Extra attention is needed label May 15, 2023
@Ncookiez
Copy link
Contributor Author

Ncookiez commented Jun 5, 2023

Fixed in #746

@Ncookiez Ncookiez closed this as completed Jun 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working confirmed This bug was confirmed good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

4 participants