Repository navigation
Fix menu transform-origin keywords - #43106
Merged
Merged
Conversation
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
julien-deramond
marked this pull request as ready for review
October 16, 2026 17:28
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.
Spotted in julien-deramond/bootstrap-test-playground#140
.menusetstransform-origintotop start,bottom start,top endandbottom end.transform-originonly accepts physical keywords (left,right,top,bottom,center), so browsers drop all of these declarations. The opening animation (scale(.95)toscale(1)) then grows from the center of the menu instead of from the corner next to the toggle.CSS.supports('transform-origin', 'top start')isfalsein Chromium, and the computedtransform-originof a.menuis50% 50%whatever its placement. This swaps the keywords for physical ones.Closes #43104.
Six placements at 640px wide, light theme. Each menu is held at
scale(.5)so the origin shows. The motion is only 5%, so in practice the change is subtle. Computedtransform-originread in Chromium:85px 50pxfor every placement before, the corner each placement names after.data-bs-placementholds the placement Floating UI computed, which is physical (bottom-startis left-aligned,bottom-endright-aligned, in LTR and RTL alike), so the keywords follow that attribute and no RTL branch is needed. Inscss/_menu.scss,top startbecomestop left,bottom startbottom left,top endandbottom endtop rightandbottom right, andleft*placements gettop right(the menu sits left of its toggle, so it grows from its right edge).right*placements keep the basetop left.leftandrightwithout a suffix still use the corner, not the middle of the edge, as the otherleft*rule did.I added
bottomandtoprules withtop centerandbottom center. Without them a plainbottomortopplacement would now grow from the left edge, where it grew from the center before (the declaration was dropped, so it was never in effect). Leaving them out would be one rule fewer. No CSS test covers computed values, so none was added.Checking https://deploy-preview-43106--twbs-bootstrap.netlify.app//docs/6.0/dist/css/bootstrap.min.css with https://htmlval.com/check.php now reports no error:
🤖 Generated with Claude Code