Skip to content

ToolsPanel: fix panel header heading rendering at the wrong size - #80729

Closed
juanfra wants to merge 2 commits into
trunkfrom
fix/toolpanel-header-styles
Closed

juanfra wants to merge 2 commits into
trunkfrom
fix/toolpanel-header-styles

Conversation

@juanfra

@juanfra juanfra commented Jul 27, 2026

Copy link
Copy Markdown
Member

What?

The ToolsPanel header sometimes renders much bigger than it should. Right now it's visible if you go to Global Styles > Layout and you see the "Dimensions" title

Why?

ToolsPanelHeading is setting font-size: inherit to override the size heading sets on itself. Those two end up as separate emotion classes with the same specificity, and they don't get merged. So whichever one is inserted into the stylesheet last wins. The order isn't guaranteed, so you could get 13px or 25px depending on that.

I also noticed line-height: normal in the same block has exactly the same problem, and it was already losing to line-height: 1.4 from Text. So that one was silently broken too. Left font-weight alone since it wasn't part of the problem, but we could also do it with it for consistency.

How?

Setting the values through props rather than trying to win the specificity.

Testing Instructions

  1. Go to Site Editor > Styles > Layout
  2. The "Dimensions" header should be the same size as the other panel headers.

Screenshots or screencast

Before After
Screenshot 2026-07-27 at 10-22-21 Blog Home ‹ Template ‹ Stories® ‹ Editor — WordPress Screenshot 2026-07-27 at 10-12-38 Blog Home ‹ Template ‹ Stories® ‹ Editor — WordPress

…rtion order, setting both via `Heading` props.
@juanfra
juanfra requested review from a team and ajitbohra as code owners July 27, 2026 08:23
@juanfra juanfra added [Type] Enhancement A suggestion for improvement. [Package] Components /packages/components labels Jul 27, 2026
@github-actions

github-actions Bot commented Jul 27, 2026 •

Copy link
Copy Markdown

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

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: juanfra <juanfra@git.wordpress.org>
Co-authored-by: mirka <0mirka00@git.wordpress.org>
Co-authored-by: aduth <aduth@git.wordpress.org>
Co-authored-by: t-hamano <wildworks@git.wordpress.org>
Co-authored-by: habiburdev <habiburdev@git.wordpress.org>
Co-authored-by: aaronrobertshaw <aaronrobertshaw@git.wordpress.org>

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

@github-actions

Copy link
Copy Markdown

Size Change: +17 B (0%)

Total Size: 7.75 MB

📦 View Changed
Filename Size Change
build/scripts/components/index.min.js 273 kB +17 B (+0.01%)

compressed-size-action

@t-hamano t-hamano added [Type] Bug An existing feature does not function as intended and removed [Type] Enhancement A suggestion for improvement. labels Jul 27, 2026
@t-hamano

Copy link
Copy Markdown
Contributor

This issue appears to be related to #79443. Let's fix it in the 7.1 release cycle.

@t-hamano t-hamano added the Backport to WP 7.2 Beta/RC Pull request that needs to be backported to the WordPress major release that's currently in beta label Jul 27, 2026
@github-project-automation github-project-automation Bot moved this to 🔎 Needs Review in WordPress 7.1 Editor Tasks Jul 27, 2026
@habiburdev

Copy link
Copy Markdown

I tested this PR in the Site Editor (Design > Styles > Layout) while using a custom user admin color scheme.

Testing Results

  • Navigated to Styles > Layout settings panel in the Site Editor.
  • Verified that slider controls (Padding, Block Spacing) and input unit selectors (px, rem) correctly inherit and display the custom user admin color scheme.
  • Controls, focus states, and active track indicators maintain proper contrast and styling according to the user profile settings.

Everything works as expected (see attached screenshot below).

Screenshot 2026-07-27 at 18-17-35

return (
<HStack { ...headerProps } ref={ forwardedRef }>
<Heading level={ headingLevel } className={ headingClassName }>
<Heading

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Can this be replaced with a Text component from wp-ui?

@aaronrobertshaw

Copy link
Copy Markdown
Contributor

Would this actually be fixed by the migration of ToolsPanel to CSS modules in #80445 ? I believe that is supposed to be the accepted approach to fixing components that were broken by moving View away from Emotion.

@mirka

mirka commented Jul 27, 2026

Copy link
Copy Markdown
Member

Would this actually be fixed by the migration of ToolsPanel to CSS modules in #80445 ?

Oh there it is. I could've sworn we fixed this somewhere but I somehow couldn't find that 🙈

@aaronrobertshaw

Copy link
Copy Markdown
Contributor

I'd vote for closing this in favour of the CSS modules approach in #80445, then. Just my two cents though

@t-hamano

Copy link
Copy Markdown
Contributor

Closing this in favour of #80445

@t-hamano t-hamano closed this Jul 28, 2026
@github-project-automation github-project-automation Bot moved this from 🔎 Needs Review to ✅ Done in WordPress 7.1 Editor Tasks Jul 28, 2026
@t-hamano t-hamano removed the Backport to WP 7.2 Beta/RC Pull request that needs to be backported to the WordPress major release that's currently in beta label Jul 28, 2026
@juanfra

juanfra commented Jul 28, 2026

Copy link
Copy Markdown
Member Author

Thank you all for reviewing! Makes sense, I wasn't aware of that initiative 🫡

@juanfra
juanfra deleted the fix/toolpanel-header-styles branch July 28, 2026 06:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Package] Components /packages/components [Type] Bug An existing feature does not function as intended

Projects

No open projects

Development

Successfully merging this pull request may close these issues.

6 participants