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

Tooltip custom variant with prop bg does not color the arrow #4695

Closed
1 of 3 tasks
arbejd opened this issue Sep 9, 2021 · 10 comments
Closed
1 of 3 tasks

Tooltip custom variant with prop bg does not color the arrow #4695

arbejd opened this issue Sep 9, 2021 · 10 comments
Labels
needs triage Issues and pull requests that need triage attention Type: Bug 🐛 Something isn't working

Comments

@arbejd
Copy link

arbejd commented Sep 9, 2021

Description

When i make a custom tooltip Variant i expect the arrow to also be colored with the bg style prop

Link to Reproduction

https://codesandbox.io/s/long-frost-9m4rm

Steps to reproduce

make a custom variant
assign to a tooltip
mouseover the tooltip

Chakra UI Version

latest

Browser

Chrome

Operating System

  • macOS
  • Windows
  • Linux

Additional Information

It works when you set the bg directly

@arbejd arbejd added needs triage Issues and pull requests that need triage attention Type: Bug 🐛 Something isn't working labels Sep 9, 2021
@anubra266
Copy link
Collaborator

@arbejd, your reproduction is just a fresh chakra UI sandbox

@segunadebayo
Copy link
Member

Thanks for reporting this issue. However, you didn't provide sufficient information for us to understand and reproduce the problem.

Please follow the issue template as we're not able to act on issues that are lacking important information.

@arbejd
Copy link
Author

arbejd commented Sep 9, 2021

Dont know why i didnt save it. I remade the repo here:

https://codesandbox.io/s/9m4rm?file=/src/index.js

@arbejd
Copy link
Author

arbejd commented Sep 9, 2021

@segunadebayo is this sufficient to reopen?

@randex
Copy link

randex commented Dec 10, 2021

While these guys play bureaucracy:

If anybody googles their way here when having the same problem (like me): define a css var popper-arrow-bg and set it to your color with colors. prefix at the start.

const $arrowBg = cssVar("popper-arrow-bg");
export default {
  baseStyle: {
    // ... other styles
    [$arrowBg.variable]: "colors.red.500",
  },
};

But the better way is to use cssVar to set both the background color and arrow color. Use the same approach as in the default tooltip theme.

@fritzschoff
Copy link

Well done! Shame that nothing is written in the docs about that

@Digital-Human-BK
Copy link

The problem still persists! Thanks to @randex. I hope this issue will be fixed...

@bj-nostra
Copy link

Broken.

I added hasArrow to the docs example and we get this nice black diamond for the blue colorScheme.

image

The issue appears to be that the tooltip itself is checking if there is a userDefinedBg user defined background coming in on props, and it ignores the theme extension mechanisms.

@acron0
Copy link

acron0 commented Apr 23, 2024

This needs to be reopened

@TiagoJeronimo
Copy link

@segunadebayo would it be possible to reopen this issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs triage Issues and pull requests that need triage attention Type: Bug 🐛 Something isn't working
Projects
None yet
Development

No branches or pull requests

9 participants