Skip to content

Typography panel: Clear the synced link colour on Reset all - #85376

Open
ramonjd wants to merge 2 commits into
trunkfrom
fix/typography-reset-all-link-color
Open

ramonjd wants to merge 2 commits into
trunkfrom
fix/typography-reset-all-link-color

Conversation

@ramonjd

@ramonjd ramonjd commented Oct 22, 2026 •

Copy link
Copy Markdown
Member

What?

Noticed while testing #84671.

"Reset all" in the Typography panel now clears the link colour that follows the text colour, as resetting the Color item on its own already does.

Why?

Setting a text colour also writes it to elements.link.color.text while the link colour tracks the text colour (added in #77279). Resetting the Color item clears both, but "Reset all" cleared only color.text.

On a block whose text is a link, like Site Title, the leftover link colour shows up two ways:

  • After "Reset all", the title keeps the old colour.
  • The next text colour doesn't reach the title. The leftover link colour no longer matches the text colour, so it stops following it.

How?

resetAllFilter now also clears elements.link.color.text when it matches the color.text being reset, the same rule the Color item's reset uses. A link colour set to something else stays. Global Styles and the block inspector share this filter.

Testing Instructions

  1. Activate Twenty Twenty-Three.
  2. Open Appearance > Editor > Styles > Blocks & Elements > Site Title.
  3. Under Typography, set Color to any palette colour. The Site Title in the canvas changes colour.
  4. Open Typography options (⋮) and choose "Reset all". The Site Title goes back to the theme's colour. On trunk it keeps the colour.
  5. Set Color again, to a different colour. The Site Title takes it. On trunk it keeps the first colour.
  6. Select a Site Title block in the canvas, set its text colour under Typography in the block inspector, then choose "Reset all" from Typography options. The colour clears.

Before

2026-10-22.20.01.56.mp4

After

2026-10-22.20.01.07.mp4

Use of AI Tools

Investigated and implemented with Claude Code; reviewed by me.

Setting a text color also writes it to `elements.link.color.text` while
the link color tracks the text color. Resetting the Color item clears
both, but Reset all cleared only `color.text`. The leftover link color
kept a link block such as Site Title in the old color, and stopped the
next text color from reaching the link.

Reset all now clears the link color when it still matches the text
color, as the Color item's reset does. A link color set to something
else is kept.
@ramonjd ramonjd added [Type] Bug An existing feature does not function as intended [Package] Block editor /packages/block-editor Global Styles Anything related to the broader Global Styles efforts, including Styles Engine and theme.json labels Oct 22, 2026
@ramonjd
ramonjd requested a review from ellatrix as a code owner October 22, 2026 09:03
@github-actions

github-actions Bot commented Oct 22, 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: ramonjd <ramonopoly@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: +54 B (0%)

Total Size: 9.05 MB

📦 View Changed
Filename Size Change
build/scripts/block-editor/index.min.js 606 kB +54 B (+0.01%)

5820404 Run

⚡ Performance

Show the results

Client side metrics exclude the server response time.

front-end-block-theme

Metric d605df2 trunk % Change
timeToFirstByte 58.85 ms +12.06% -3.65% 58.1 ms +3.44% -4.56% 1.29%
largestContentfulPaint 100 ms +4% -8% 96 ms +6.25% -4.17% 4.17%
lcpMinusTtfb 36.55 ms +7.93% -3.69% 37.55 ms +16.11% -3.99% -2.66%
wpBeforeTemplate 30.96 ms +17.54% -2.2% 30.55 ms +11.88% -3.37% 1.34%
wpTemplate 23.47 ms +6.31% -5.97% 22.76 ms +4.66% -7.07% 3.12%
wpTotal 54.96 ms +10.92% -4.04% 53.9 ms +4.1% -4.04% 1.97%
wpMemoryUsage 7.66 MB +0% -0% 7.63 MB +0% -0% 0.43%
wpDbQueries 16 +0% -0% 16 +0% -0% 0%

front-end-classic-theme

Metric d605df2 trunk % Change
timeToFirstByte 50.4 ms +6.35% -2.58% 48.7 ms +6.98% -2.26% 3.49%
largestContentfulPaint 108 ms +3.7% -0% 104 ms +3.85% -0% 3.85%
lcpMinusTtfb 58.55 ms +1.45% -1.02% 55.95 ms +1.43% -1.61% 4.65%
wpBeforeTemplate 28.69 ms +3.83% -1.95% 27.69 ms +7.3% -2.28% 3.61%
wpTemplate 18.01 ms +5% -2.83% 17.19 ms +1.92% -2.09% 4.77%
wpTotal 47.24 ms +6.14% -2.84% 45.31 ms +7.31% -1.94% 4.26%
wpMemoryUsage 6.35 MB +0% -0% 6.32 MB +0% -0% 0.53%
wpDbQueries 13 +0% -0% 13 +0% -0% 0%

media-processing

Metric d605df2 trunk % Change
mediaProcessingJpeg 407.96 ms +1.64% -0.85% 407.18 ms +0.98% -1.15% 0.19%
mediaProcessingAvif 6148.37 ms +0.22% -0.26% 6136.73 ms +0.39% -0.13% 0.19%
mediaProcessingJpegToAvif 4243.44 ms +0.16% -0.17% 4254.41 ms +0.13% -0.9% -0.26%

media-upload

Metric d605df2 trunk % Change
jpegUploadProcessing 1730.66 ms +14.43% -16.3% 1462.29 ms +0.53% -0.65% 18.35%
pngUploadProcessing 212.12 ms +11.46% -3.64% 234.15 ms +1.76% -3.76% -9.41%
largeJpegUploadProcessing 1914.41 ms +0.86% -25.34% 1443.99 ms +0.48% -1.04% 32.58%
multipleImageUploadProcessing 2090.75 ms +0.94% -1.01% 2071.06 ms +0.88% -1.7% 0.95%

post-editor

Metric d605df2 trunk % Change
serverResponse 416.54 ms +3.89% -3.37% 389.5 ms +7.29% -1.91% 6.94%
firstPaint 484.88 ms +7.83% -54.2% 304.26 ms +63.88% -33.57% 59.36%
domContentLoaded 1161.88 ms +1.67% -0.59% 1199.2 ms +1.63% -4.04% -3.11%
loaded 1163.08 ms +1.66% -0.59% 1200.25 ms +1.65% -4.04% -3.1%
firstContentfulPaint 510.5 ms +2.42% -8.02% 523.01 ms +4.5% -4.67% -2.39%
firstBlock 3423.97 ms +2.34% -2.43% 3555.99 ms +0.67% -6.38% -3.71%
type 18.37 ms +1.63% -2.67% 19.05 ms +1.63% -2.2% -3.57%
typeWithoutInspector 18.46 ms +2.65% -1.84% 19.1 ms +13.51% -5.55% -3.35%
typeWithTopToolbar 23.97 ms +1.04% -3.3% 23.32 ms +6% -2.66% 2.79%
typeContainer 8.64 ms +6.02% -8.45% 9 ms +9.33% -5.89% -4%
focus 124.63 ms +3% -4.04% 121.56 ms +0.81% -2.48% 2.53%
firstFocus 239.88 ms +0% -0% 230.1 ms +0% -0% 4.25%
selectAll 537.48 ms +1.71% -1.37% 559.28 ms +2.52% -6.53% -3.9%
listViewOpen 75.44 ms +9.7% -3.61% 77.32 ms +13.85% -1.9% -2.43%
inserterOpen 42.22 ms +5.45% -6.66% 41.05 ms +6.55% -8.53% 2.85%
inserterHover 12.31 ms +8.04% -8.12% 11.41 ms +10.6% -3.59% 7.89%
inserterSearch 8.5 ms +7.41% -5.06% 8.52 ms +5.28% -6.46% -0.23%
loadPatterns 638.95 ms +4.46% -3.83% 628.11 ms +3% -2.39% 1.73%
wpTotal 405.58 ms +4.05% -3.39% 378.65 ms +7.65% -1.92% 7.11%
wpMemoryUsage 14.70 MB +0% -0% 14.66 MB +0% -0% 0.24%
wpDbQueries 55 +0% -1.82% 55 +0% -1.82% 0%

site-editor

Metric d605df2 trunk % Change
serverResponse 336.2 ms +5.59% -6.33% 329.72 ms +3.07% -4.88% 1.97%
firstPaint 229.57 ms +13.66% -18.71% 204.18 ms +4.9% -7.99% 12.44%
domContentLoaded 981.83 ms +2.01% -0.86% 973.79 ms +1.49% -1.47% 0.83%
loaded 982.68 ms +2.01% -0.83% 974.75 ms +1.49% -1.5% 0.81%
firstContentfulPaint 419.42 ms +2.28% -1.81% 414.14 ms +3.1% -1.92% 1.27%
firstBlock 3670.69 ms +0.88% -1.21% 3632.7 ms +1.11% -2.07% 1.05%
type 17.05 ms +6.86% -2.93% 17.89 ms +2.24% -3.47% -4.7%
navigate 109.47 ms +4.23% -4.11% 101.05 ms +23.33% -2.35% 8.33%
loadPatterns 1109.59 ms +14.25% -4.66% 1068 ms +8.22% -4.13% 3.89%
loadPages 966.97 ms +1.38% -0.79% 995.09 ms +2.23% -5.44% -2.83%
wpTotal 328.07 ms +5.29% -6.32% 321.57 ms +2.78% -5.14% 2.02%
wpMemoryUsage 12.71 MB +0% -0% 12.68 MB +0% -0% 0.27%
wpDbQueries 44 +2.27% -0% 44 +2.27% -0% 0%

5820404 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
chevron opens and closes submenu on touch devices in /test/e2e/specs/editor/blocks/navigation-frontend-interactivity.spec.js, passed after 1 failed attempt.
TimeoutError: locator.click: Timeout 10000ms exceeded.
Call log:
  - waiting for getByRole('button', { name: 'Submenu submenu' })
    - locator resolved to <button aria-expanded="false" aria-label="Submenu submenu" data-wp-on--click="actions.toggleMenuOnClick" data-wp-bind--aria-expanded="state.isSubmenuOpen" class="wp-block-navigation__submenu-icon wp-block-navigation-submenu__toggle">…</button>
  - attempting click action
    - waiting for element to be visible, enabled and stable
    - element is visible, enabled and stable
    - scrolling into view if needed
    - done scrolling
    - performing click action
    - <a class="ab-item" role="menuitem" href="https://wordpress.org/">WordPress.org</a> from <div class="nojq" id="wpadminbar">…</div> subtree intercepts pointer events
  - retrying click action
    - waiting for element to be visible, enabled and stable
    - element is visible, enabled and stable
    - scrolling into view if needed
    - done scrolling
    - <a class="ab-item" role="menuitem" href="https://wordpress.org/">WordPress.org</a> from <div class="nojq" id="wpadminbar">…</div> subtree intercepts pointer events
  - retrying click action
    - waiting 20ms
    2 × waiting for element to be visible, enabled and stable
      - element is visible, enabled and stable
      - scrolling into view if needed
      - done scrolling
      - <a class="ab-item" role="menuitem" href="https://wordpress.org/">WordPress.org</a> from <div class="nojq" id="wpadminbar">…</div> subtree intercepts pointer events
    - retrying click action
      - waiting 100ms
    19 × waiting for element to be visible, enabled and stable
       - element is visible, enabled and stable
       - scrolling into view if needed
       - done scrolling
       - <a class="ab-item" role="menuitem" href="https://wordpress.org/">WordPress.org</a> from <div class="nojq" id="wpadminbar">…</div> subtree intercepts pointer events
     - retrying click action
       - waiting 500ms

    at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/editor/blocks/navigation-frontend-interactivity.spec.js:840:23
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-22T09:22:23", "date_gmt": "2026-10-22T09:22:23", "description": {"rendered": "<p class=\"attachment\"><a href='http://localhost:8889/wp-content/uploads/2026/10/6aa7f503-c4c8-45c1-a35d-be0196498beb.png'><img loading=\"lazy\" decoding=\"async\" width=\"10\" height=\"10\" src=\"http://localhost:8889/wp-content/uploads/2026/10/6aa7f503-c4c8-45c1-a35d-be0196498beb.png\" class=\"attachment-medium size-medium\" alt=\"\" style=\"width:100%;height:100%;max-width:10px;\" /></a></p>
"}, "featured_media": 0, "filename": "6aa7f503-c4c8-45c1-a35d-be0196498beb.png", "filesize": 80, "guid": {"rendered": "http://localhost:8889/wp-content/uploads/2026/10/6aa7f503-c4c8-45c1-a35d-be0196498beb.png"}, "id": 223, "link": "http://localhost:8889/?attachment_id=223", "media_details": {"file": "2026/10/6aa7f503-c4c8-45c1-a35d-be0196498beb.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-22T09:22:23", "modified_gmt": "2026-10-22T09:22:23", "ping_status": "closed", "post": 222, "slug": "6aa7f503-c4c8-45c1-a35d-be0196498beb", "source_url": "http://localhost:8889/wp-content/uploads/2026/10/6aa7f503-c4c8-45c1-a35d-be0196498beb.png", "status": "inherit", "template": "", "title": {"rendered": "6aa7f503-c4c8-45c1-a35d-be0196498beb"}, "type": "attachment"}]
    at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/editor/various/single-file-placeholder-drop.spec.js:71:45

5820404 Run

Copilot AI 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.

🟢 Approval recommended

The narrow change follows existing reset semantics and includes regression coverage, with no blocking issues identified; tests were not executed.

No open issues 🎉

What changed in this PR

This PR aligns Typography’s “Reset all” behavior with the individual Color reset in the shared panel used by Global Styles and the block inspector.

Changes:

  • Clears the link color when it matches the text color being reset, while preserving a different link color.
  • Adds regression tests for both outcomes and a package changelog entry.
File Description
packages/​block-editor/​src/​components/​global-styles/​typography-panel.tsx Clears matching link colors during “Reset all.”
packages/​block-editor/​src/​components/​global-styles/​test/​typography-panel.browser.test.tsx Tests matching-color removal and distinct-color preservation.
packages/​block-editor/​CHANGELOG.md Documents the reset fix.

Review effort: Balanced

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

Global Styles Anything related to the broader Global Styles efforts, including Styles Engine and theme.json [Package] Block editor /packages/block-editor [Type] Bug An existing feature does not function as intended

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants