react-component / tooltip

React Tooltip
http://react-component.github.io/tooltip/
MIT License
924 stars 188 forks source link

Styling with Emotion's css prop #468

Open weiying-chen opened 9 months ago

weiying-chen commented 9 months ago

I tried styling the tooltip with Emotion's css prop:

const tooltipStyle = css`
  .rc-tooltip {
    background: yellow;

    &.rc-tooltip-hidden {
      display: none;
    }
  }
`;

function handle (node) {
  return (
    <Tooltip css={tooltipStyle} placement="top" overlay={<span>tooltip</span>}>
      { node }
    </Tooltip>
  );
}

But the styles aren't being applied. What could be the reason?