Repository navigation
Block Supports: Add translate property on X and Y axis to Transform supports - #86282
Draft
aaronrobertshaw wants to merge 5 commits into
Draft
aaronrobertshaw wants to merge 5 commits into
aaronrobertshaw wants to merge 5 commits into
Conversation
Store style.transform.translate as an object with x and y axes and output the individual translate property, validated in the style engine, theme.json and KSES. Add X offset and Y offset controls to the Transform panel and opt in Group, Heading, Image and Video.
Cover the style engine, theme.json, KSES, the block support, block states, the Transform panel and global styles rendering. Extend the e2e spec with an Image offset, its caption and lightbox, and a Mobile offset on a Heading.
🤖 PR meta 🤖📦 Bundle sizeSize Change: +459 B (+0.01%) Total Size: 8.59 MB 📦 View Changed
⚡ PerformanceShow the resultsClient side metrics exclude the server response time. front-end-block-theme
front-end-classic-theme
media-processing
media-upload
post-editor
site-editor
🏁 Flaky testsSome tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information. Undo restores the post selection when another synced entity is loaded (RTC WebSocket) in
|
This branch has not been 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.
Important
This builds on #86240 and should merge after it. Its base is that PR's branch.
Related:
What?
Adds an X and Y offset to the Transform block support, through the CSS
translateproperty. It combines with rotation. Group, Heading, Image and Video opt in.Why?
Blocks cannot be nudged away from where the layout puts them. The grid canvas work in #85505, where blocks are placed freely, needs this too.
How?
style.transform.translateis{ x, y }. Each axis is one length or percentage.translateproperty, nevertransform. A missing axis is0.calc(),var(), lists and other values.zkey fails the schema and PHP drops it.Z is left out. It needs
perspectiveon a parent, so it can follow later as one more key.Testing Instructions
3rem, and every Heading moves.Screenshots or screencast
translate.mp4
Use of AI Tools
Written with Claude Code, then reviewed and tested.