shadcn-ui / ui

Beautifully designed components that you can copy and paste into your apps. Accessible. Customizable. Open Source.
https://ui.shadcn.com
MIT License
75.12k stars 4.69k forks source link

[bug]: Tooltip on Themes page doesn't inherit theme #5886

Open chris-orgorg opened 2 days ago

chris-orgorg commented 2 days ago

Describe the bug

On the Themes page:

https://ui.shadcn.com/themes

When hovering over the new message button in the ChatDemo, the Tooltip portals in on the body, which is outside the .theme-red selector so the tooltip doesn't inherit the theme.

I think one potential solution could be to change the tooltip.tsx component to portal the tooltip content in relative to the tooltip root vs. on document.body.

Affected component/components

Documentation, Tooltip

How to reproduce

  1. Go to https://ui.shadcn.com/themes
  2. Hover on new message button in ChatDemo
  3. Notice tooltip is black, when it should be red if the red theme is selected.

Codesandbox/StackBlitz link

https://ui.shadcn.com/themes

Logs

No response

System Info

Mac, Chrome

Before submitting