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

Theme provider does not work for Button component customization #1445

Open
mkmule opened this issue Jul 10, 2024 · 2 comments
Open

Theme provider does not work for Button component customization #1445

mkmule opened this issue Jul 10, 2024 · 2 comments

Comments

@mkmule
Copy link

mkmule commented Jul 10, 2024

  • [x ] I have searched the Issues to see if this bug has already been reported
  • [x ] I have tested the latest version

Steps to reproduce

  1. Create theme provider
  2. Wrap children (layout)

Current behavior

Theme is NOT applying to Button component, but applies to Dropdown Button

Expected behavior

Theme should be applying to Button component AND Dropdown Button

Context

Override theme globally for all component used under specific layout. Next.js Application, app router.

Current behavior:
image

Theme override

import { CustomFlowbiteTheme } from "flowbite-react";
import { Flowbite } from "flowbite-react";

const customTheme: CustomFlowbiteTheme = {
  button: {
    "size": {
      "md": "px-4 py-2 text-2xl",
    }
  }
} as CustomFlowbiteTheme;

export default function FlowbiteAppTheme({ children }: any) {
  return (
    <Flowbite theme={{ theme: customTheme }}>
      {children}
    </Flowbite>
  );
}

Actual usage in react component (page/screen)

      <div className="border-2 border-blue-100 p-4 flex gap-3">
        <Button outline color={'light'}>Test single</Button>

        <Button theme={customButtonTheme} outline color={'light'}>Test with theme as prop</Button>

        <Dropdown label={'Test in dropdown'} color={'light'}>
          <DropdownItem>Dolor Sit</DropdownItem>
          <DropdownItem>Lorem Ipsum</DropdownItem>
        </Dropdown>
      </div>
image
@mkmule mkmule changed the title Theme provider does not override Button component customization Theme provider does not work for Button component customization Jul 10, 2024
@m1daz
Copy link

m1daz commented Aug 9, 2024

Why does this not have more information? This is an on-going issue for me. Please fix ASAP. I can't have my UI looking like it has birth defects with some components applying theme some not.

@rluders
Copy link
Collaborator

rluders commented Aug 9, 2024

@m1daz the project is open source and every contribution here is made by volunteers. If you want to make a contribution to have it fixed a PR is very welcome. This is the best way to get it ASAP.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants