Skip to content

Commit

Permalink
Add anchor styles for tooltip placement
Browse files Browse the repository at this point in the history
  • Loading branch information
brookewp committed Mar 17, 2023
1 parent 0a4134d commit a1eb09a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
7 changes: 6 additions & 1 deletion packages/components/src/ui/ariakit-tooltip/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,16 @@ function UnforwardedToolTip(
const cx = useCx();

const ToolTipClassName = cx( styles.ToolTip );
const ToolTipAnchorClassName = cx( styles.ToolTipAnchor );
const ShortcutClassName = cx( styles.Shortcut );

return (
<>
<TooltipAnchor state={ tooltipState } ref={ forwardedRef }>
<TooltipAnchor
className={ ToolTipAnchorClassName }
ref={ forwardedRef }
state={ tooltipState }
>
{ children }
</TooltipAnchor>
{ ( text || shortcut ) && (
Expand Down
4 changes: 4 additions & 0 deletions packages/components/src/ui/ariakit-tooltip/styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ export const ToolTip = css`
z-index: 1000002;
`;

export const ToolTipAnchor = css`
display: inline-block;
`;

export const Shortcut = css`
margin-left: ${ space( 2 ) };
`;

0 comments on commit a1eb09a

Please sign in to comment.