Skip to content
Open
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
5 changes: 5 additions & 0 deletions .changeset/fix-metabar-tooltip-clipping.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@doc-kit/generator-react': patch
---

Fix stability badge tooltips being cut off in the MetaBar's table of contents
27 changes: 27 additions & 0 deletions packages/react/src/html/ui/components/MetaBar/index.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,30 @@
display: inline-block;
margin-left: 0.25rem;
}

/*
* The MetaBar's list scrolls on its own (`overflow-y: auto`), which also clips
* anything that overflows it horizontally. The stability tooltip is centred on
* its badge and can be wider than the space left beside it, so it was cut off.
*
* Anchor the tooltip to the whole table-of-contents row instead, and keep it
* no wider than that row, so it always fits inside the MetaBar.
*/
li:has(> a > .badge) {
position: relative;
}

.badge[data-tooltip] {
position: static;
}

.badge[data-tooltip]::after {
left: 0;
max-width: 100%;
translate: none;
}

/* The arrow would point at the middle of the row, not at the badge */
.badge[data-tooltip]::before {
display: none;
}