nextui-org / nextui

🚀 Beautiful, fast and modern React UI library.
https://nextui.org
MIT License
21.94k stars 1.53k forks source link

[BUG] - Modal not applying nextui tailwind plugin theme custom properties #1703

Open josegutierro opened 1 year ago

josegutierro commented 1 year ago

NextUI Version

2.1.13

Describe the bug

When using Modal component theme overrides on tailwind.config are not being applied, things like colors, border radius are displayed like base default theme.

Your Example Website or App

No response

Steps to Reproduce the Bug or Issue

  1. Customize your tailwind.config.js with some nextui theme Screenshot 2023-09-27 at 12 27 00
  2. Use the modal component Screenshot 2023-09-27 at 12 27 39

Expected behavior

Primary button should be orange and radius smaller as defined on theme.

Screenshots or Videos

Screenshot 2023-09-27 at 12 27 00 Screenshot 2023-09-27 at 12 27 39

Operating System Version

MacOS

Browser

Chrome

ZijiaZhang commented 1 year ago

I had a similar issue, but I was able to fix it by adding 'bg-background text-foreground' class to the body.

image

StephenDickens-WAG commented 1 year ago

I'm having a similar issue using background gradients inside a Modal component. I was able to get my custom themes to work by programmatically setting the theme className on the body element, but for some reason the native tailwind gradient CSS variables aren't defined/applied correctly.

Screenshot 2023-10-17 at 12 18 21 AM

Gradients are working perfectly fine everywhere else in the app, as the following screenshot shows the native tailwind CSS variables are defined/applied correctly:

Screenshot 2023-10-17 at 12 28 06 AM

EDIT 1:

Since the theme colors work, I was able to get the gradient to work using inline styles along with the color variables. Still strange the native tailwind classNames didn't work though...

Screenshot 2023-10-17 at 2 16 24 PM Screenshot 2023-10-17 at 2 16 04 PM

EDIT 2:

Looks like gradients work fine as long as you define the from-X% and to-X% classNames. So the only issue is the default tailwind CSS variables aren't defined/applied.

Screenshot 2023-10-17 at 5 02 38 PM