Skip to content

[FEAT REQ] Arrow coloring enhancement #1065

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

Closed
russell-holz opened this issue Jul 24, 2023 · 2 comments · Fixed by #1079
Closed

[FEAT REQ] Arrow coloring enhancement #1065

russell-holz opened this issue Jul 24, 2023 · 2 comments · Fixed by #1079

Comments

@russell-holz
Copy link

Is your feature request related to a problem? Please describe.
I only want to color the protruding section of the arrow

Describe the solution you'd like
A prop or solution to just color the protruding arrow section

Describe alternatives you've considered
Tried to do it with css but having issues selecting just one section because of the way the arrow is drawn and would have to implement solutions for every arrow position

Additional context
The provided classNameArrow background color solution results in the entire box being colored like so...

Screen Shot 2023-07-24 at 4 02 01 PM

I want to be able to just color the protruding section like so...

Screen Shot 2023-07-24 at 4 02 01 PM copy
@gabrieljablonski gabrieljablonski changed the title Arrow coloring enhancement [FEAT REQ] Arrow coloring enhancement Jul 24, 2023
@gabrieljablonski
Copy link
Member

gabrieljablonski commented Jul 24, 2023

I'll leave this open for now since it might be viable in the future, but for now you can try something like this:

.react-tooltip__place-top > .react-tooltip-arrow {
  background: linear-gradient(to right bottom, transparent 50%, red 50%);
}

.react-tooltip__place-right > .react-tooltip-arrow {
  background: linear-gradient(to left bottom, transparent 50%, red 50%);
}

.react-tooltip__place-bottom > .react-tooltip-arrow {
  background: linear-gradient(to left top, transparent 50%, red 50%);
}

.react-tooltip__place-left > .react-tooltip-arrow {
  background: linear-gradient(to right top, transparent 50%, red 50%);
}

Just switch out red and you should be good to go.

@gabrieljablonski
Copy link
Member

gabrieljablonski commented Jul 24, 2023

Just leaving this here as a note for myself in the future

/* internal css arrow class */
.arrow {
  ...
  /* this rotation should be relative to the tooltip placement, so the arrow "tip" is always the same CSS-wise */
  transform: rotate(45deg);
}

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

Successfully merging a pull request may close this issue.

2 participants