Skip to content

Query Pagination Numbers: Add border and padding support - #85245

Merged
aaronrobertshaw merged 2 commits into
trunkfrom
add/query-pagination-numbers-border
Oct 21, 2026
Merged

aaronrobertshaw merged 2 commits into
trunkfrom
add/query-pagination-numbers-border

Conversation

@aaronrobertshaw

@aaronrobertshaw aaronrobertshaw commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Replaces #66401 by @rinkalpagdar.

Related:

What?

Adds border (color, radius, style and width) and padding support to the Page Numbers block.

Why?

Theme authors and site owners cannot frame the page numbers with a border or padding. The block only has background controls.

How?

Adds __experimentalBorder and spacing.padding to the block's block.json supports, with both controls shown by default. It follows #66401, with the styles on the wrapper, where the background already applies. Margin is left out because the parent Query Pagination owns the space between its children.

A new style.scss adds box-sizing: border-box, as in Comments Pagination Next (#64310). No PHP change is needed. With one page the block renders nothing, so there is no empty box.

Testing Instructions

Setup: a Query Loop with Pagination and several pages of posts.

  1. No styles: the numbers render as before.
  2. Global Styles > Blocks > Page Numbers > Border: 2px solid, then Padding: 20px.
    • One border and the padding wrap all the numbers, in the editor and on the front end.
    • The current page and dots are unchanged.
  3. Global Styles, Mobile state: 4px dotted.
    • Editor: View > Responsive styles > Mobile. Front end: mobile width.
    • The mobile value shows. Desktop keeps step 2.
  4. Block inspector: 6px dashed, 16px radius, 60px padding.
    • The block value wins at every width: it has no mobile state of its own and outranks Global Styles.
  5. Block inspector, Mobile selected: 8px double, 24px radius.
    • The block mobile value wins.

Screenshots or screencast

composite

Use of AI Tools

Implemented, built and screenshotted by a Claude Code agent from a predefined task.

Co-authored-by: Rinkal Pagdar <92097119+rinkalpagdar@users.noreply.github.com>
@aaronrobertshaw aaronrobertshaw added [Type] Enhancement A suggestion for improvement. [Package] Block library /packages/block-library Global Styles Anything related to the broader Global Styles efforts, including Styles Engine and theme.json [Feature] Design Tools Tools that impact the appearance of blocks both to expand the number of tools and improve the experi labels Oct 20, 2026
@aaronrobertshaw aaronrobertshaw self-assigned this Oct 20, 2026
@github-actions

github-actions Bot commented Oct 20, 2026 •

Copy link
Copy Markdown

🤖 PR meta 🤖

Preview in WordPress Playground

🎉 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>

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

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

📦 Bundle size

Size Change: +378 B (0%)

Total Size: 9.05 MB

📦 View Changed
Filename Size Change
build/scripts/block-library/index.min.js 445 kB +36 B (+0.01%)
build/styles/block-library/query-pagination-numbers/style-rtl.css 84 B +84 B (new file) 🆕
build/styles/block-library/query-pagination-numbers/style-rtl.min.css 76 B +76 B (new file) 🆕
build/styles/block-library/query-pagination-numbers/style.css 84 B +84 B (new file) 🆕
build/styles/block-library/query-pagination-numbers/style.min.css 76 B +76 B (new file) 🆕
build/styles/block-library/style-rtl.css 22.8 kB +6 B (+0.03%)
build/styles/block-library/style-rtl.min.css 19.4 kB +5 B (+0.03%)
build/styles/block-library/style.css 22.9 kB +6 B (+0.03%)
build/styles/block-library/style.min.css 19.3 kB +5 B (+0.03%)

de83010 Run

⚡ Performance

Show the results

Client side metrics exclude the server response time.

front-end-block-theme

Metric 5e1d6d5 trunk % Change
timeToFirstByte 58.3 ms +6.6% -4.46% 63.1 ms +8.32% -4.99% -7.61%
largestContentfulPaint 100 ms +6% -8% 100 ms +8% -0% 0%
lcpMinusTtfb 37.6 ms +15.82% -2.66% 37.5 ms +11.33% -4.8% 0.27%
wpBeforeTemplate 30.61 ms +9.28% -4.21% 32.24 ms +12.72% -3.54% -5.06%
wpTemplate 22.69 ms +7.14% -2.6% 25.57 ms +4.18% -3.75% -11.26%
wpTotal 54.28 ms +6.82% -4.42% 58.97 ms +7% -5.19% -7.95%
wpMemoryUsage 7.65 MB +0% -0% 7.61 MB +0% -0% 0.52%
wpDbQueries 16 +0% -0% 16 +0% -0% 0%

front-end-classic-theme

Metric 5e1d6d5 trunk % Change
timeToFirstByte 51.4 ms +6.52% -3.21% 53.9 ms +4.36% -3.34% -4.64%
largestContentfulPaint 110 ms +1.82% -1.82% 112 ms +3.57% -1.79% -1.79%
lcpMinusTtfb 57.75 ms +3.46% -1.99% 58.15 ms +2.41% -0.6% -0.69%
wpBeforeTemplate 28.87 ms +10.15% -2.67% 29.81 ms +9.36% -3.39% -3.15%
wpTemplate 18.8 ms +4.95% -4.15% 19.92 ms +5.57% -4.62% -5.62%
wpTotal 48.03 ms +6.85% -3.29% 50.51 ms +3.86% -3.74% -4.91%
wpMemoryUsage 6.34 MB +0% -0% 6.30 MB +0% -0% 0.64%
wpDbQueries 13 +0% -0% 13 +0% -0% 0%

media-processing

Metric 5e1d6d5 trunk % Change
mediaProcessingJpeg 405.9 ms +1.56% -0.33% 409.95 ms +0.48% -0.25% -0.99%
mediaProcessingAvif 6233.99 ms +0.27% -0.31% 6191.65 ms +0.22% -0.32% 0.68%
mediaProcessingJpegToAvif 4315.89 ms +0.26% -0.31% 4270.41 ms +0.01% -0.29% 1.07%

media-upload

Metric 5e1d6d5 trunk % Change
jpegUploadProcessing 1978.38 ms +6.61% -1.14% 1933.67 ms +0.45% -0.34% 2.31%
pngUploadProcessing 255.92 ms +10.62% -20.21% 213.01 ms +24.23% -8.3% 20.14%
largeJpegUploadProcessing 1942.77 ms +0.74% -0.18% 1941.33 ms +0.12% -0.28% 0.07%
multipleImageUploadProcessing 2104.43 ms +1.05% -3.03% 2045.89 ms +1.72% -0.1% 2.86%

post-editor

Metric 5e1d6d5 trunk % Change
serverResponse 269.35 ms +2.97% -12.81% 276.75 ms +5.03% -8.42% -2.67%
firstPaint 334.61 ms +2.57% -22.34% 340.43 ms +1.27% -20.3% -1.71%
domContentLoaded 737.15 ms +2.28% -1.94% 736.14 ms +1.44% -0.87% 0.14%
loaded 737.87 ms +2.3% -1.93% 736.9 ms +1.45% -0.88% 0.13%
firstContentfulPaint 342.28 ms +3.26% -2.48% 340.43 ms +1.27% -2.37% 0.54%
firstBlock 2133.13 ms +1.07% -1.28% 2163.95 ms +2.17% -2.42% -1.42%
type 12.87 ms +4.74% -1.48% 14.08 ms +8.1% -0.85% -8.59%
typeWithoutInspector 12.61 ms +3.25% -2.06% 13.91 ms +4.67% -4.1% -9.35%
typeWithTopToolbar 16.08 ms +5.16% -2.86% 17.05 ms +7.16% -5.16% -5.69%
typeContainer 6.33 ms +13.59% -7.11% 6.41 ms +7.49% -5.3% -1.25%
focus 74.81 ms +4.76% -1.9% 74.33 ms +5.8% -4.26% 0.65%
firstFocus 145.07 ms +0% -0% 149.63 ms +0% -0% -3.05%
selectAll 346.03 ms +4.19% -0.21% 356.49 ms +5.52% -1.5% -2.93%
listViewOpen 49.82 ms +5.54% -10.1% 47.28 ms +4.48% -3.57% 5.37%
inserterOpen 28.92 ms +2.39% -9.54% 27 ms +5.67% -4.19% 7.11%
inserterHover 8.72 ms +4.7% -4.47% 8.23 ms +5.22% -2.31% 5.95%
inserterSearch 6.71 ms +6.11% -3.87% 6.75 ms +13.04% -6.67% -0.59%
loadPatterns 442.91 ms +1.38% -3.6% 415.7 ms +4.21% -1.96% 6.55%
wpTotal 262.08 ms +2.68% -13.11% 269.03 ms +4.79% -8.53% -2.58%
wpMemoryUsage 14.69 MB +0% -0% 14.63 MB +0% -0% 0.42%
wpDbQueries 55 +0% -0% 55 +0% -0% 0%

site-editor

Metric 5e1d6d5 trunk % Change
serverResponse 515.94 ms +8.85% -4.27% 518.14 ms +6.86% -8.44% -0.42%
firstPaint 304.33 ms +51.6% -5.98% 242.94 ms +36.75% -5.85% 25.27%
domContentLoaded 1326.4 ms +2.15% -5.7% 1307.02 ms +1.75% -0.22% 1.48%
loaded 1328.78 ms +2.06% -5.76% 1308.41 ms +1.73% -0.22% 1.56%
firstContentfulPaint 530.97 ms +5.12% -8.21% 531.1 ms +3.07% -1.98% -0.02%
firstBlock 4970.15 ms +1.17% -1.37% 5006.41 ms +0.42% -0.93% -0.72%
type 18.58 ms +6.35% -2.21% 21.08 ms +6.59% -4.55% -11.86%
navigate 139.43 ms +8.8% -3.59% 140.51 ms +7.98% -6.28% -0.77%
loadPatterns 1407.68 ms +13.52% -5.02% 1363.28 ms +7.63% -16.13% 3.26%
loadPages 1048.42 ms +4% -1.09% 1007.5 ms +2.73% -1.51% 4.06%
wpTotal 505.86 ms +8.99% -4.31% 508.31 ms +6.99% -8.76% -0.48%
wpMemoryUsage 12.70 MB +0% -0% 12.66 MB +0% -0% 0.32%
wpDbQueries 44 +2.27% -0% 44 +2.27% -0% 0%

de83010 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.

Regression: updating a specific option will only change its value and will not corrupt others in /test/e2e/specs/editor/various/core-settings.spec.js, passed after 1 failed attempt.
Error: expect(received).toStrictEqual(expected) // deep equality

- Expected  - 1
+ Received  + 1

  Array [
    "rewrite_rules",
-   "SERIALIZED DATA",
+   "",
  ]
    at forEach (/home/runner/work/gutenberg/gutenberg/test/e2e/specs/editor/various/core-settings.spec.js:46:26)
    at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/editor/various/core-settings.spec.js:43:35
drags a multi-selection from a block nested in a selected block in /test/e2e/specs/editor/various/draggable-blocks.spec.js, passed after 1 failed attempt.
TypeError: Cannot read properties of null (reading 'y')
    at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/editor/various/draggable-blocks.spec.js:989:57
    at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/editor/various/draggable-blocks.spec.js:988:3
keeps the blocks selected after dropping a multi-selection in /test/e2e/specs/editor/various/draggable-blocks.spec.js, passed after 1 failed attempt.
TypeError: Cannot read properties of null (reading 'y')
    at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/editor/various/draggable-blocks.spec.js:824:57
    at dragSelectionBelowLanding (/home/runner/work/gutenberg/gutenberg/test/e2e/specs/editor/various/draggable-blocks.spec.js:823:3)
    at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/editor/various/draggable-blocks.spec.js:908:3
refuses the drop and uploads nothing in /test/e2e/specs/editor/various/single-file-placeholder-drop.spec.js, passed after 1 failed attempt.
Error: expect(received).toHaveLength(expected)

Expected length: 0
Received length: 1
Received array:  [{"_links": {"about": [{"href": "http://localhost:8889/wp-json/wp/v2/types/attachment"}], "author": [{"embeddable": true, "href": "http://localhost:8889/wp-json/wp/v2/users/1"}], "collection": [{"href": "http://localhost:8889/wp-json/wp/v2/media"}], "curies": [{"href": "https://api.w.org/{rel}", "name": "wp", "templated": true}], "replies": [{"embeddable": true, "href": "http://localhost:8889/wp-json/wp/v2/comments?post=223"}], "self": [{"href": "http://localhost:8889/wp-json/wp/v2/media/223", "targetHints": {"allow": ["GET", "POST", "PUT", "PATCH", "DELETE"]}}], "wp:attached-to": [{"embeddable": true, "href": "http://localhost:8889/wp-json/wp/v2/posts/222", "id": 222, "post_type": "post"}]}, "alt_text": "", "author": 1, "caption": {"rendered": ""}, "class_list": ["post-223", "attachment", "type-attachment", "status-inherit", "hentry", "entry"], "comment_status": "open", "date": "2026-10-21T06:32:25", "date_gmt": "2026-10-21T06:32:25", "description": {"rendered": "<p class=\"attachment\"><a href='http://localhost:8889/wp-content/uploads/2026/10/b5734533-06d9-4565-b74f-9b1ace6f78a1.png'><img loading=\"lazy\" decoding=\"async\" width=\"10\" height=\"10\" src=\"http://localhost:8889/wp-content/uploads/2026/10/b5734533-06d9-4565-b74f-9b1ace6f78a1.png\" class=\"attachment-medium size-medium\" alt=\"\" style=\"width:100%;height:100%;max-width:10px;\" /></a></p>
"}, "featured_media": 0, "filename": "b5734533-06d9-4565-b74f-9b1ace6f78a1.png", "filesize": 80, "guid": {"rendered": "http://localhost:8889/wp-content/uploads/2026/10/b5734533-06d9-4565-b74f-9b1ace6f78a1.png"}, "id": 223, "link": "http://localhost:8889/?attachment_id=223", "media_details": {"file": "2026/10/b5734533-06d9-4565-b74f-9b1ace6f78a1.png", "filesize": 80, "height": 10, "image_meta": {"alt": "", "aperture": "0", "camera": "", "caption": "", "copyright": "", "created_timestamp": "0", "credit": "", "focal_length": "0", "iso": "0", "keywords": [], "orientation": "0", "shutter_speed": "0", "title": ""}, "sizes": {}, "width": 10}, "media_type": "image", "meta": [], "mime_type": "image/png", "modified": "2026-10-21T06:32:25", "modified_gmt": "2026-10-21T06:32:25", "ping_status": "closed", "post": 222, "slug": "b5734533-06d9-4565-b74f-9b1ace6f78a1", "source_url": "http://localhost:8889/wp-content/uploads/2026/10/b5734533-06d9-4565-b74f-9b1ace6f78a1.png", "status": "inherit", "template": "", "title": {"rendered": "b5734533-06d9-4565-b74f-9b1ace6f78a1"}, "type": "attachment"}]
    at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/editor/various/single-file-placeholder-drop.spec.js:71:45

de83010 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.

Testing nicely for me in global styles, at the individual block level, and with responsive styles editing mode. LGTM!

Image

Just left an optional question about which controls we set by default, but not in any way a blocker.

🚢

@aaronrobertshaw
aaronrobertshaw enabled auto-merge (squash) October 21, 2026 06:20
@aaronrobertshaw
aaronrobertshaw merged commit 8c51d09 into trunk Oct 21, 2026
80 checks passed
@aaronrobertshaw
aaronrobertshaw deleted the add/query-pagination-numbers-border branch October 21, 2026 06:47
@github-actions github-actions Bot added this to the Gutenberg 24.4 milestone Oct 21, 2026
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 Global Styles Anything related to the broader Global Styles efforts, including Styles Engine and theme.json [Package] Block library /packages/block-library [Type] Enhancement A suggestion for improvement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants