Repository navigation
Icon Block: Add flip and rotate transformation controls #77017
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
t-hamano
merged 8 commits into
WordPress:trunk
from
dhruvikpatel18:feat/add-icon-flip-feature
Jun 14, 2026
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
9febafa
Icon Block: Add flip horizontal and vertical features with correspond…
dhruvikpatel18 eaa9c07
Fix: Use null coalescing operator for current style in icon block ren…
dhruvikpatel18 d3d63f0
Implement flip horizontal and vertical classes for SVG rendering
dhruvikpatel18 4858dfb
Adds rotation functionality
dhruvikpatel18 ab51c62
Merge branch 'trunk' into feat/add-icon-flip-feature
dhruvikpatel18 2a74046
Remove accidentally re-added i18n-cache directory
dhruvikpatel18 f77a7dc
updated styles and labels
dhruvikpatel18 0bede4e
Add flip attributes to core/icon and reorder attributes in core/image…
dhruvikpatel18 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
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
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
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ideally, it should be possible to set any angle, not just the four angles of 0, 90, 180, and 270. For example, here is a UI that would allow this:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm actually not sure; I think that might be best handled by a separate tool we can explore for animation in a more generic sense; i.e. I think the argument is valid for any block, not specifically the icon block.
And specifically for the icon block, by default, I would constrain it to the cardinal directions. The thing is, even if they are SVGs, they are designed on a precise pixel grid, which is also why we are being careful about the default size increments suggested. It can scale and rotate, but especially on older 1x resolution monitors, the hinting matters. This hinting is intact in the straight degree rotations, but not on the arbitrary ones.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the feedback!
Should we remove the Rotate setting itself, or is rotation in 90-degree increments allowed?
I understand your intention, but I think it's fine to use an ad-hoc approach for now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the 90 degree increments are okay, since the hinting will be intact there. I can't think of a ton of use cases; mostly the arrows, and they already exist in the cardinal directions. But one use case would be vertical text, with a vertical icon.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it is necessary allow custom values when adding controls that privilege presets. In this case, and seconding that the approach is applicable to most blocks, I would add it in the Styles tab in the block inspector. But agree with @t-hamano that ad-hoc is the best approach to start.