Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions packages/demo/src/content/components/tooltip.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,18 @@ Use `side` and `align` on `TooltipContent` to position the tooltip relative to i
</TooltipContent>
```

## Width

`TooltipContent` caps itself at `32rem`, and narrows further to the room Radix measures when the trigger sits near a viewport edge, so long content wraps instead of running off screen. Retheme the `--container-tooltip` token to move the cap everywhere.

For a one-off, mark the override important — the component's own styles sit outside Tailwind's layers, so a plain utility loses to them:

```tsx
<TooltipContent className="max-w-md!">
<p>Narrower than the default</p>
</TooltipContent>
```

## Slots

| Name | Description |
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@eqtylab/equality",
"description": "EQTYLab's component and token-based design system",
"homepage": "https://equality.eqtylab.io/",
"version": "3.3.0",
"version": "3.3.1",
"license": "Apache-2.0",
"keywords": [
"component library",
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/src/components/tooltip/tooltip.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

.tooltip-content {
@apply z-highest;
@apply overflow-hidden rounded-md;
@apply max-w-tooltip overflow-hidden rounded-md;
@apply border-border-overlay bg-background-overlay border;
@apply shadow-shadow-overlay shadow-sm;
@apply text-text-primary text-sm;
Expand Down
3 changes: 3 additions & 0 deletions packages/ui/src/theme/theme-base.css
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
/* FONT SIZE */
--text-xxs: 0.625rem;

/* CONTAINER — keep in this inline block; the Radix var exists only on the tooltip content element */
--container-tooltip: min(32rem, var(--radix-tooltip-content-available-width, 100vw));

/* Z-INDEX */
--z-index-behind: -1;
--z-index-base: 0;
Expand Down
Loading