Skip to content

Commit

Permalink
Add --transform-origin CSS variable
Browse files Browse the repository at this point in the history
  • Loading branch information
atomiks committed Apr 11, 2024
1 parent 11f1654 commit dc34e32
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions docs/data/base/components/tooltip/tooltip.md
Original file line number Diff line number Diff line change
Expand Up @@ -247,12 +247,14 @@ The `Tooltip.Content` element receives the following CSS variables:
- `--anchor-height`: Specifies the height of the anchor element. You can use this to match the width of the tooltip with its anchor.
- `--available-width`: Specifies the available width of the tooltip element before it overflows the viewport.
- `--available-height`: Specifies the available height of the tooltip element before it overflows the viewport.
- `--transform-origin`: Specifies the origin of the floating element that represents the point of the anchor element's center. When animating scale, this allows it to correctly emanate from the center of the anchor.

```jsx
<Tooltip.Content
style={{
width: 'var(--tooltip-anchor-width)',
height: 'var(--tooltip-anchor-height)',
width: 'var(--anchor-width)',
height: 'var(--anchor-height)',
transformOrigin: 'var(--transform-origin)',
}}
>
Content
Expand Down

0 comments on commit dc34e32

Please sign in to comment.