Skip to content

Block Supports: Add a uniform scale to Transform supports - #86727

Open
aaronrobertshaw wants to merge 4 commits into
add/transform-translatefrom
add/transform-scale
Open

aaronrobertshaw wants to merge 4 commits into
add/transform-translatefrom
add/transform-scale

Conversation

@aaronrobertshaw

@aaronrobertshaw aaronrobertshaw commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

Important

This builds on #86282 and should merge after it. Its base is that PR's branch.

Related:

What?

Adds a scale to the Transform block support, through the CSS scale property. Group, Heading and Video opt in.

Why?

Blocks cannot grow or shrink without changing their content or layout. A featured card is a common case.

How?

  • Value: style.transform.scale is one non-negative number, such as 1.2, or a percentage, such as "120%".
  • Output: the scale property, never transform, saved inline like the rotation. A 0 is kept.
  • Validation: style engine, theme.json and KSES drop negatives, lists, calc() and var().
  • UI: a number field with a slider that starts at 1. The slider stops at 3; typing goes up to 10. Clearing lets an inherited scale show again.
  • Same as rotation and offsets: states, Global Styles, appearanceTools, settings and skip serialization.
"core/heading": {
	"transform": { "scale": 1.2 }
}

Testing Instructions

Use a theme with appearanceTools, such as Twenty Twenty-Five.

  1. On a Group with a background, add Styles > Transform > Scale. The slider starts at 1.
  2. Drag it up. The Group grows around its centre, in the editor and front end.
  3. Clear the field. The scale is removed, not saved as 1.
  4. On a Heading, set a scale for Mobile only. Desktop stays the same size.
  5. Add the theme.json value above. Every Heading scales; a Heading set to 0.8 wins.

Screenshots or screencast

86727-scale.mp4

Use of AI Tools

Written with Claude Code, then reviewed and tested.

@aaronrobertshaw aaronrobertshaw added [Type] Enhancement A suggestion for improvement. [Package] Blocks /packages/blocks [Package] Block library /packages/block-library [Package] Block editor /packages/block-editor [Feature] Design Tools Tools that impact the appearance of blocks both to expand the number of tools and improve the experi [Package] Style Engine /packages/style-engine labels Nov 12, 2026
@aaronrobertshaw aaronrobertshaw self-assigned this Nov 12, 2026
@github-actions

github-actions Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

🤖 PR meta 🤖

Preview in WordPress Playground Preview in Storybook

🎉 Props

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: aaronrobertshaw <aaronrobertshaw@git.wordpress.org>
Co-authored-by: andrewserong <andrewserong@git.wordpress.org>
Co-authored-by: tellthemachines <isabel_brison@git.wordpress.org>
Co-authored-by: jameskoster <jameskoster@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.


Props Bot commands

You can trigger Props Bot actions by commenting on this PR:

  • @propsbot add <username> to give props to a GitHub user. Requires write access.
  • @propsbot remove <username> to leave a user out of the props. Requires write access.
  • @propsbot refresh to refresh this list. Adding the props-bot label works too.

Updated as activity occurs, without notifying anyone named here. Add the props-bot label to refresh.

📦 Bundle size

Size Change: +520 B (+0.01%)

Total Size: 8.67 MB

📦 View Changed
Filename Size Change
build/modules/lazy-editor/index.min.js 14.6 kB +2 B (+0.01%)
build/scripts/block-editor/index.min.js 557 kB +403 B (+0.07%)
build/scripts/block-library/index.min.js 427 kB +11 B (0%)
build/scripts/blocks/index.min.js 45 kB +13 B (+0.03%)
build/scripts/edit-site/index.min.js 383 kB +2 B (0%)
build/scripts/editor/index.min.js 572 kB +4 B (0%)
build/scripts/style-engine/index.min.js 2.64 kB +85 B (+3.33%)

770bb88 Run

⚡ Performance

Show the results

Client side metrics exclude the server response time.

front-end-block-theme

Metric 4711032 add/transform-translate % Change
timeToFirstByte 49.9 ms +3.71% -4.71% 50 ms +5.1% -3.9% -0.2%
largestContentfulPaint 80 ms +7.5% -5% 84 ms +4.76% -2.38% -4.76%
lcpMinusTtfb 29.4 ms +16.16% -3.4% 37.05 ms +3.78% -23.21% -20.65%
wpBeforeTemplate 24.65 ms +4.95% -4.83% 24.32 ms +5.51% -2.14% 1.36%
wpTemplate 20.65 ms +7.6% -3.29% 20.99 ms +4.05% -4.62% -1.62%
wpTotal 45.94 ms +3.92% -4.57% 45.91 ms +5.53% -3.75% 0.07%
wpMemoryUsage 7.75 MB +0% -0% 7.74 MB +0% -0% 0.19%
wpDbQueries 16 +0% -0% 16 +0% -0% 0%

front-end-classic-theme

Metric 4711032 add/transform-translate % Change
timeToFirstByte 41.25 ms +4.61% -2.55% 40.3 ms +5.33% -1.86% 2.36%
largestContentfulPaint 76 ms +5.26% -0% 76 ms +0% -0% 0%
lcpMinusTtfb 35.1 ms +3.7% -1.57% 35.15 ms +3.27% -5.69% -0.14%
wpBeforeTemplate 21.87 ms +4.66% -2.06% 21.52 ms +6.32% -2.09% 1.63%
wpTemplate 15.72 ms +1.72% -4.77% 15.5 ms +3.23% -2.9% 1.42%
wpTotal 37.89 ms +3.09% -3.01% 37.36 ms +4.9% -2.38% 1.42%
wpMemoryUsage 6.44 MB +0% -0% 6.43 MB +0% -0% 0.22%
wpDbQueries 13 +0% -0% 13 +0% -0% 0%

media-processing

Metric 4711032 add/transform-translate % Change
mediaProcessingJpeg 419.58 ms +1.02% -0.9% 417.35 ms +0.32% -0.83% 0.53%
mediaProcessingAvif 6355.13 ms +0.52% -0.09% 6354.12 ms +0.3% -0.06% 0.02%
mediaProcessingJpegToAvif 4376.93 ms +0.38% -0.05% 4367.82 ms +0.18% -0.31% 0.21%

media-upload

Metric 4711032 add/transform-translate % Change
jpegUploadProcessing 1997.9 ms +3.64% -24.35% 1496.53 ms +0.71% -0.99% 33.5%
pngUploadProcessing 265.8 ms +2.4% -3.18% 266.86 ms +1.08% -4.37% -0.4%
largeJpegUploadProcessing 1506.69 ms +0.98% -0.8% 1508.17 ms +0.57% -0.56% -0.1%
multipleImageUploadProcessing 2096.4 ms +0.08% -5.97% 2095.46 ms +0.77% -1.46% 0.04%

post-editor

Metric 4711032 add/transform-translate % Change
serverResponse 332.57 ms +2.56% -9.89% 326.52 ms +0.97% -1.09% 1.85%
firstPaint 355.47 ms +6.82% -8.26% 319.78 ms +8.28% -3.76% 11.16%
domContentLoaded 640.7 ms +12.17% -1.5% 633.92 ms +0.92% -1.57% 1.07%
loaded 641.48 ms +12.17% -1.46% 634.72 ms +0.94% -1.53% 1.07%
firstContentfulPaint 360.76 ms +18.47% -1.41% 370.58 ms +0.39% -2.37% -2.65%
firstBlock 1726.7 ms +3.49% -0.88% 1708.52 ms +1.7% -0.39% 1.06%
type 15.58 ms +6.1% -12.97% 14.43 ms +8.32% -6.24% 7.97%
typeWithoutInspector 14.38 ms +8.83% -2.23% 14.61 ms +11.02% -11.57% -1.57%
typeWithTopToolbar 20.25 ms +4.49% -7.65% 18.99 ms +3.74% -6.06% 6.64%
typeContainer 6.57 ms +4.87% -8.83% 6.67 ms +2.55% -6.15% -1.5%
focus 99.91 ms +5.62% -9.49% 96.28 ms +3.35% -10.07% 3.77%
firstFocus 202.12 ms +0% -0% 207.13 ms +0% -0% -2.42%
selectAll 313.37 ms +0.27% -0.7% 304.98 ms +4.28% -2.63% 2.75%
undo 23.46 ms +8.27% -2.81% 24.18 ms +5% -4.92% -2.98%
listViewOpen 61.79 ms +2.4% -9.74% 60.32 ms +8.85% -8.21% 2.44%
inserterOpen 33.22 ms +18.36% -1.9% 32.63 ms +7.54% -0.49% 1.81%
inserterHover 9.36 ms +8.97% -5.98% 9.54 ms +9.22% -6.08% -1.89%
inserterSearch 6.71 ms +12.67% -3.87% 6.45 ms +7.44% -4.5% 4.03%
loadPatterns 501.19 ms +5.56% -1.7% 519.46 ms +2.23% -3.9% -3.52%
wpTotal 323.98 ms +2.2% -10.16% 317.82 ms +0.89% -1.08% 1.94%
wpMemoryUsage 14.81 MB +0% -0% 14.78 MB +0% -0% 0.22%
wpDbQueries 55 +0% -0% 55 +0% -0% 0%

site-editor

Metric 4711032 add/transform-translate % Change
serverResponse 406.37 ms +1.27% -1.39% 400.79 ms +0.4% -8.2% 1.39%
firstPaint 426.29 ms +12.22% -9.74% 399.69 ms +0.93% -2.47% 6.66%
domContentLoaded 832.04 ms +0.38% -0.6% 811.43 ms +0.71% -0.74% 2.54%
loaded 832.96 ms +0.39% -0.56% 812.65 ms +0.66% -0.75% 2.5%
firstContentfulPaint 458.52 ms +4.34% -2.63% 449.76 ms +1% -0.66% 1.95%
firstBlock 2441.59 ms +4.82% -0.83% 2402.82 ms +1.22% -1.01% 1.61%
type 18.17 ms +5.39% -8.59% 17.51 ms +3.08% -6.23% 3.77%
navigate 113.78 ms +3.42% -2.11% 109.8 ms +2.14% -3.85% 3.62%
loadPatterns 1292.55 ms +13.6% -12.21% 1416.75 ms +11.1% -5.68% -8.77%
loadPages 928.99 ms +1.46% -1.71% 937.05 ms +1.28% -3.51% -0.86%
wpTotal 396.17 ms +1.46% -1.39% 390.97 ms +0.47% -8.43% 1.33%
wpMemoryUsage 12.84 MB +0% -0% 12.82 MB +0% -0% 0.15%
wpDbQueries 45 +0% -0% 45 +0% -0% 0%

770bb88 Run

🏁 Flaky tests

Some 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 /test/e2e/specs/editor/collaboration/collaboration-undo-redo.spec.ts, passed after 1 failed attempt.
Error: expect(received).toMatchObject(expected)

- Expected  - 2
+ Received  + 2

  Object {
    "attributeKey": "content",
    "blockIndex": 0,
    "content": "abcdef",
-   "endOffset": 3,
-   "offset": 3,
+   "endOffset": 1,
+   "offset": 1,
  }

Call Log:
- Timeout 5000ms exceeded while waiting on the predicate
    at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/editor/collaboration/collaboration-undo-redo.spec.ts:363:5
does not select blocks in the canvas preview when editing from the sidebar (Site Editor v2) in /test/e2e/specs/site-editor/navigation-sidebar-list-view.spec.js, passed after 1 failed attempt.
Error: expect(locator).toBeFocused() failed

Locator: getByRole('combobox', { name: 'Search or type URL' })
Expected: focused
Timeout: 5000ms
Error: element(s) not found

Call log:
  - Expect "toBeFocused" getByRole('combobox', { name: 'Search or type URL' }) with timeout 5000ms
  - waiting for getByRole('combobox', { name: 'Search or type URL' })

    at LinkControl.useLinkControlSearch (/home/runner/work/gutenberg/gutenberg/test/e2e/specs/site-editor/navigation-sidebar-list-view.spec.js:416:47)
    at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/site-editor/navigation-sidebar-list-view.spec.js:179:21
falls back to the first tab when the default tab is removed in /test/e2e/specs/editor/blocks/tabs.spec.js, passed after 1 failed attempt.
Error: expect(received).toBe(expected) // Object.is equality

Expected: 1
Received: 0

Call Log:
- Timeout 5000ms exceeded while waiting on the predicate
    at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/editor/blocks/tabs.spec.js:344:60
should apply a named font size using the font size buttons in /test/e2e/specs/editor/various/font-size-picker.spec.js, passed after 1 failed attempt.
Error: expect(received).toBe(expected) // Object.is equality

- Expected  - 2
+ Received  + 2

- <!-- wp:paragraph {"fontSize":"large"} -->
+ <!-- wp:paragraph {"fontSize":"medium"} -->
- <p class="has-large-font-size">Paragraph to be made "large"</p>
+ <p class="has-medium-font-size">Paragraph to be made "large"</p>
  <!-- /wp:paragraph -->

Call Log:
- Timeout 5000ms exceeded while waiting on the predicate
    at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/editor/various/font-size-picker.spec.js:153:6
should reset a named font size using input field in /test/e2e/specs/editor/various/font-size-picker.spec.js, passed after 1 failed attempt.
Error: expect(received).toBe(expected) // Object.is equality

- Expected  - 2
+ Received  + 2

- <!-- wp:paragraph {"fontSize":"small"} -->
+ <!-- wp:paragraph {"fontSize":"tiny"} -->
- <p class="has-small-font-size">Paragraph with font size reset using input field</p>
+ <p class="has-tiny-font-size">Paragraph with font size reset using input field</p>
  <!-- /wp:paragraph -->

Call Log:
- Timeout 5000ms exceeded while waiting on the predicate
    at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/editor/various/font-size-picker.spec.js:216:6
should reset a named font size using the tools panel menu in /test/e2e/specs/editor/various/font-size-picker.spec.js, passed after 1 failed attempt.
Error: expect(received).toBe(expected) // Object.is equality

- Expected  - 2
+ Received  + 2

- <!-- wp:paragraph {"fontSize":"medium"} -->
+ <!-- wp:paragraph {"fontSize":"small"} -->
- <p class="has-medium-font-size">Paragraph with font size reset using tools panel menu</p>
+ <p class="has-small-font-size">Paragraph with font size reset using tools panel menu</p>
  <!-- /wp:paragraph -->

Call Log:
- Timeout 5000ms exceeded while waiting on the predicate
    at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/editor/various/font-size-picker.spec.js:178:6

From 1c1b9c1, not the current head. Run

@andrewserong andrewserong left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a quick drive-by comment from playing around with this. It's so cool! For me personally, I think it'll be a really fun one for the Button block, especially with states like hover. I.e. here's how that can look with rotation, scale, and a little shadow:

2026-11-16.12.07.00.mp4
image

A very minor note, but while playing around making the above, I found myself wanting a range control slider for scale, as for this kind of design it's more about playfully messing around with values rather than going for something precise. I liked being able to drag the dial on the rotation control, so felt a similar desire to grab and drag a slider for scale, too 😄. Worth trying here?

(Haven't looked at the code yet, but will take a look through the stack this week)

@tellthemachines

Copy link
Copy Markdown
Contributor

This is exciting, you can do all sorts of wacky stuff with the transform controls combined!

Screenshot 2026-11-16 at 3 15 33 pm

One thing I notice with the scale control is that if I start interaction by clicking the arrow up instead of writing a number in the box, it jumps from the default 1 to 0.01 which makes the block seem to disappear because it becomes tiny:

Screenshot 2026-11-16 at 3 09 25 pm

Would be better if arrow incremented the value already set in the box.

@jameskoster

Copy link
Copy Markdown
Contributor

It might be more intuitive to present scale as a percentage, I guess that would also fix the keyboard interaction too.

@aaronrobertshaw

Copy link
Copy Markdown
Contributor Author

Thanks for all the testing and feedback here 🙇

We can definitely tweak the UI. Given the stack of Transform block support PRs and several UX enhancements as separate PRs to follow them. I might bump the UI tweaks here to a follow up and have this merged sooner and iterate.

For now, I'll leave this open until I get the base Transform and UX improvements merged. Then I'll roll this out and iterate in quick succession.

The scale feature saves a single non-negative number or percentage inline
like the rotation and offset. A numeric 0 is kept: the style engine reads
numeric transform values as strings, so the support, block style states
and Global Styles all output it.

Group, Heading and Video adopt it. Transform tools, including the scale,
are switched on by appearanceTools.
The theme.json schema tests for scale now use Group, so they do not
depend on the Image block.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Feature] Design Tools Tools that impact the appearance of blocks both to expand the number of tools and improve the experi [Package] Block editor /packages/block-editor [Package] Block library /packages/block-library [Package] Blocks /packages/blocks [Package] Style Engine /packages/style-engine [Type] Enhancement A suggestion for improvement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants