refactor: migrate tooltip and popover to CSS Anchor Positioning#5990
refactor: migrate tooltip and popover to CSS Anchor Positioning#5990
Conversation
|
… detection Co-authored-by: mfranzke <787658+mfranzke@users.noreply.github.com>
Co-authored-by: mfranzke <787658+mfranzke@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
There was a problem hiding this comment.
The placement isn't working. Always opens to the bottom.
There was a problem hiding this comment.
There is a gap between the button and the tooltip, and it isn't centered anymore
There was a problem hiding this comment.
take no prisoners development.
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Migrates tooltip and popover positioning from JavaScript to CSS Anchor Positioning for modern browsers, with JavaScript fallback for older browser compatibility.
CSS Changes
_popover-component.scss: Added@supports (anchor-name: --db-popover-anchor)block with:position-anchorandposition-areafor all placement variantsposition-try-fallbackswithflip-block,flip-inlinefor automatic collision detectiontooltip.scss: Addedanchor-nameon[data-has-tooltip="true"]parentpopover.scss: Addedanchor-nameon.db-popovercontainerJavaScript Feature Detection
floating-components.ts:supportsCSSAnchorPositioning()for consumers to detect supporthandleFixedPopover()andhandleFixedDropdown()skip JS positioning when CSS handles itBrowser Support
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.
🔭🐙🐈 Test this branch here: https://design-system.deutschebahn.com/core-web/review/copilot/migrate-tooltip-popover-css