react-portal-tooltip icon indicating copy to clipboard operation
react-portal-tooltip copied to clipboard

Make FG_SIZE & BG_SIZE props

Open ndelangen opened this issue 7 years ago • 3 comments

Hey, I'd like my ToolTip to have a bit more padding around the arrow.

If i understand the code correctly the FG_SIZE & BG_SIZE constants are used for calculating the paddings/margins/positions.

Would you accept a PR making these constants props?

ndelangen avatar Sep 13 '18 07:09 ndelangen

I was able to get the visual I wanted using the transform property:

const style = {
  // TODO: take from theme
  style: {
    minWidth: 250,
    borderRadius: 4,
    backgroundColor: '#ffffff',
    boxShadow: '0 5px 15px 0 rgba(0, 0, 0, 0.1), 0 2px 5px 0 rgba(0, 0, 0, 0.05)',
    transition: 'none',
    animation: `${appear.name} 0.16s linear`,
    transform: 'translateX(-10px)',
  },
  arrowStyle: {
    color: 'white',
    borderColor: false,
    transform: 'translateX(10px)',
  },
};

Sadly this only works for my exact use-case. When the arrow is in another place it will look out of place.

ndelangen avatar Sep 13 '18 08:09 ndelangen

More padding around the arrow

Can you explain? Not understanding what the expectation here would be. Would the arrow be smaller? More space between the tooltip and the arrow? Screenshots would be helpful

Redmega avatar Sep 19 '18 12:09 Redmega

The arrow would be positioned further from the edge of the tooltip.

┌^--------┐
|         |
└---------┘

vs

┌--^------┐
|         |
└---------┘

ndelangen avatar Sep 23 '18 14:09 ndelangen