[color-swatch] Fix popover centering in Firefox (regression)#235
Open
DmitrySharabin wants to merge 1 commit into
Open
[color-swatch] Fix popover centering in Firefox (regression)#235DmitrySharabin wants to merge 1 commit into
DmitrySharabin wants to merge 1 commit into
Conversation
✅ Deploy Preview for color-elements ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
LeaVerou
reviewed
Jun 5, 2026
| bottom: anchor(top); | ||
| left: anchor(center); | ||
| translate: -50% 0; | ||
| margin-bottom: calc(var(--_pointer-height) * 0.8); |
Member
There was a problem hiding this comment.
Suggested change
| margin-bottom: calc(var(--_pointer-height) * 0.8); | |
| margin-block-end: calc(var(--_pointer-height) * 0.8); |
Member
Author
There was a problem hiding this comment.
I excluded the change from the PR. It wasn't necessary. Simply margin was OK.
f4f37b3 to
0a7b61a
Compare
Use anchor() functions instead of position-area: top for popover positioning. Firefox does not center the popover with position-area when the anchor is inside a chart's complex layout context. Note: Firefox still clips anchor-positioned top-layer elements by ancestor overflow:hidden — a browser bug with no known workaround. No existing Bugzilla report found; needs to be filed. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
0a7b61a to
a20b5fa
Compare
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.
Summary
anchor()functions (bottom: anchor(top),left: anchor(center)) instead ofposition-area: topfor popover positioningposition-areawhen the anchor is inside a chart's complex layout context (e.g.contain: size, absolute positioning)Known issue: Firefox still clips anchor-positioned top-layer elements by ancestor
overflow: hidden— a browser bug with no CSS-only workaround. No existing Bugzilla report found; needs to be filed.Test plan
flip-blockstill works when swatch is near viewport top edge🤖 Generated with Claude Code