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

[BUG] - Certain components do not inherit theme from wrapper #4571

Open
yahiaBSK opened this issue Jan 16, 2025 · 4 comments
Open

[BUG] - Certain components do not inherit theme from wrapper #4571

yahiaBSK opened this issue Jan 16, 2025 · 4 comments

Comments

@yahiaBSK
Copy link

yahiaBSK commented Jan 16, 2025

Describe the bug

  • When i change the theme from the main wrapper ClassName (i'm using tailwindCSS + nextUI), every comopnent change their theme fine without issues. But not all nextUI components, Where's that certain components are not inherit that theme anymore and they stuck on the "Default theme" anyway.
  • In my case i've faced this issue in these components: Autocomplete, Modal, Dropdown, Navbar (Only NavbarMenu).
  • and this is the main Wrapper code of those components:
`createRoot(document.getElementById("root")).render(
  <StrictMode>
    <BrowserRouter>
      <QueryClientProvider client={new QueryClient()}>
        <NextUIProvider className="light text-foreground bg-background">
          <LayoutWrapper />
        </NextUIProvider>
      </QueryClientProvider>
    </BrowserRouter>
  </StrictMode>
);`
  • In the image bellow an exemple of the issue in Autocomplete component.

Your Example Website or App

No response

Steps to Reproduce the Bug or Issue

Add one or more components from the these ones ( Autocomplete, Modal, Dropdown, Navbar (Only NavbarMenu) ), and give the main Wrapper of them a Classname="light text-foreground bg-background", and you'll see that they're taking the default theme as theires anyway.

Expected behavior

As a user, i expected from the components to get the same theme of their wrapper component.

Screenshots or Videos

Image

Operating System Version

  • OS: Windows 11

Browser

Chrome

Copy link

linear bot commented Jan 16, 2025

@brunostyle
Copy link

I have also had this problem for a long time, but there is still no solution.

@ryo-manba
Copy link
Member

Thank you for creating this issue! Could you provide a minimal reproducible environment, such as on StackBlitz? This would help us resolve the issue more quickly.

@ryo-manba ryo-manba changed the title [BUG] - NOT ALL COMPONENTS ARE INHERIT THE MAIN THEME [BUG] - Certain components do not inherit theme from wrapper Jan 19, 2025
@yahiaBSK
Copy link
Author

@ryo-manba I did that , you can check it here : https://stackblitz.com/edit/vitejs-vite-7oj3wtyv?file=src%2FApp.jsx

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

No branches or pull requests

3 participants