Skip to content

Conversation

@youknowriad
Copy link
Contributor

What?

One of the principles of our UI components in general is to avoid relying on global "reset" styles that might come from WordPress styles or else. This PR fixes a case in the Tab component where the font size was relying on a a reset applied to the button element in the forms.css file coming from WordPress. Instead the font size is set to "inherit" to always inherit the default font size of the current application.

Testing Instructions

  • Open the inserter
  • Inspect the "tabs" elements in Chrome
  • Disable the CSS targetting button element that comes from the form.css file of WordPress
  • The tabs should still show in the right font size (and not smaller)

@youknowriad youknowriad requested a review from a team August 26, 2025 07:52
@youknowriad youknowriad self-assigned this Aug 26, 2025
@youknowriad youknowriad requested a review from ajitbohra as a code owner August 26, 2025 07:52
@youknowriad youknowriad added the [Type] Bug An existing feature does not function as intended label Aug 26, 2025
@github-actions
Copy link

github-actions bot commented Aug 26, 2025

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: youknowriad <[email protected]>
Co-authored-by: ciampo <[email protected]>
Co-authored-by: aduth <[email protected]>
Co-authored-by: mirka <[email protected]>
Co-authored-by: jasmussen <[email protected]>

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

@github-actions
Copy link

Flaky tests detected in b659ae6.
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.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/17231718153
📝 Reported issues:

cursor: pointer;
line-height: 1.2; // Characters in some languages (e.g. Japanese) may have a native higher line-height.
font-weight: 400;
font-size: inherit;
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this be $font-size-medium instead?

cc @WordPress/gutenberg-design

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't mind, but just noting that for now, I used inherit to avoid any behavior change in WordPress.

Copy link
Member

Choose a reason for hiding this comment

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

I don't mind, but just noting that for now, I used inherit to avoid any behavior change in WordPress.

My understanding is that wouldn't be a behavior change, it'd just be making explicit what we're already expecting as a style in WordPress.

(It's also what's specified in the Figma designs)

Copy link
Contributor

Choose a reason for hiding this comment

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

"Medium" is 13px, which is almost certainly what it already inherits, and is the right thing here.

I do think there's a chance we can revisit the typography scale in the design system file, to be clear. But no concrete plans.

Copy link
Contributor Author

@youknowriad youknowriad Aug 27, 2025

Choose a reason for hiding this comment

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

Both inherit and medium are going to result in 13px now. The question is whether we want tabs to use the regular "app level font size" or have an explicit font size. Both can be valid, for instance writing random paragraphs and lists don't have explicit font sizes, they'll just inherit the app level one.

I changed to explicit for now though for tabs.

@ciampo ciampo requested a review from a team August 26, 2025 15:10
Copy link
Member

@mirka mirka left a comment

Choose a reason for hiding this comment

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

Thanks for the fix. I also think using the Sass var instead of inherit should be fine.

@youknowriad youknowriad enabled auto-merge (squash) August 27, 2025 09:46
@youknowriad youknowriad merged commit dfba7c9 into trunk Aug 27, 2025
71 of 72 checks passed
@youknowriad youknowriad deleted the fix/components-tab branch August 27, 2025 10:17
@github-actions github-actions bot added this to the Gutenberg 21.6 milestone Aug 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Type] Bug An existing feature does not function as intended

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants