Repository navigation
feat(theme): align the tooltip recipes with Open Components - #376
Merged
alexgrozav merged 2 commits intoOct 29, 2026
Merged
Conversation
Open a tooltip with the popover attribute in the top layer, place it with a new placement axis and CSS anchor positioning, and flip it when there's no room. Wrap the content at 32ch, keep its edge in forced colours mode, and only fade it in under reduced motion. The arrow turns with placement and sits on the edge that faces the trigger.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Assert each placement of the arrow whole, so a second coloured side, a dropped fill or a moved inset fails. Show the anchoring CSS in the docs, say that the width changed, and keep the stories' ids and anchor names unique on the docs page.
7 of 13 tasks
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Brings the
tooltipandtooltip-arrowrecipes in line with the Open Components Tooltip standard, for every rule a stylesheet decides.popoverattribute,useTooltipRecipesetsposition: fixed,inset: autoand the new@tooltip.offsetmargin, hides the tooltip while it's closed, and places it withposition-areafrom a newplacementaxis (topby default, thenbottom,startandend).position-try-fallbacks: flip-block, flip-inlineflips it when there's no room. All of this is scoped to.tooltip[popover]in the setup callback, so every other use keeps today's output and the@z-index.tooltiplayer.useTooltipArrowRecipegets the sameplacementaxis. It draws its triangle incolor, uses logical properties, and sits centred on the edge that faces the trigger inside a top-layer tooltip. The defaulttopgeometry and the colour of every compound stay the same.32chrather than240px, withoverflow-wrap: anywhere, so a long word breaks inside the box.@starting-style. Underprefers-reduced-motion: reduceit only fades.CanvasandCanvasText, and its border marks the edge, the soft variant's included. The border-drawn arrow hides.tooltipContrast.test.tschecks the text of all 9 colour × variant compounds in both themes. The lowest is 7.2:1.Storybook gets
TopLayer,PlacementsandFocusstories, and the inline styles in the freeform example are gone. The docs page gets an Accessibility section.Related issue
None.
Type of change
Checklist
feat(theme): …)pnpm build:nodocs && pnpm lint && pnpm typecheck && pnpm testand everything passes (ranpnpm build:nodocs, plus the touched packages' checks: theme typecheck and its full suite of 3676 tests, oxfmt and oxlint on the touched files, the Storybook build with vue-tsc, and the docs build withtest:build. I didn't run the root-wide lint, typecheck or test)pnpm changeset) for changes to publishable packages, or this change only touches docs/storybook/app/playground/testsdist/,.styleframe/)mainand stays focused in scope (it targets the integration branchalign-component-styles-uxf-487, which goes tomainas one PR)Notes / screenshots
tooltip/points-at-triggeralso asks the arrow to follow the tooltip when a fallback flips it. CSS can't tell which fallback was chosen, so a script has to set the arrow'splacement, as the reference implementation does withdata-side. The docs say so. An@container anchored(fallback: …)query does it in CSS in Chrome, but Vite's lightningcss minifier can't parse it and fails the build, so it isn't used.transition-duration: 0sunder reduced motion, so there the fade is instant too.tooltip/fallback-positionneeds script, so it's out of scope here.