I have a rounded div
tooltip of a variable height that contains some scrolling content. On the left of it is an arrow that points to the element that triggered it being shown. The arrow can be located anywhere on the left side and the height of the tooltip container varies. Currently I have the arrow implemented as a css triangle with ::before
and ::after
pseudo-elements for the background and border.
I'm trying to extend the scrolling content of the tooltip div into the background of the arrow on the left side and am at a loss as to how to do it. I've looked at the css clip
property but it only works with rectangles. -webkit-mask-image
seems interesting but can't account for the dynamic placement of the arrow and variable height of the tooltip container. Maintaining a border and shadow around everything is important to me too.
I'm looking for a solution that will at very least work in the latest Chrome, Safari, and Firefox. I'm willing to fallback to something else in other browsers that can't support the effect.
Any ideas on how this can be done? I've been thinking about this for a while and really been at a loss.
Below is how I'm trying to make the tooltip look. The content inside scrolls and that scrolling can be seen inside the arrow.