-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Button: update font-weight to 500
#70787
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Size Change: +76 B (0%) Total Size: 2.2 MB
ℹ️ View Unchanged
|
|
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 If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
|
In general I support this change for the reasons outlined in #64744. But there are a few knock-on effects to consider: Inspector
For me this is okay, with the exception of the Content panel. The text in the rows there should probably remain at their current wait to maintain visual consistency with the List view panel. Text buttons in toolbars
This also seems okay. In fact on my screen the text weight feels more aligned with the icon weight which feels like a small win. Inserter buttons
I don't have a strong feeling on this one so will defer to others. But like the toolbar, on my screen the text and icons feel a bit more cohesive. ItemGroup
No strong feelings on this one either. DropdownMenu
This one feels quite clunky. Should probably remain at the original weight to maintain alignment with |
tyxla
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code-wise this looks good, but then it's mostly a design change. Let's ship once we have a design ✅
|
It would be nice if we could take into account that the default font may vary from OS to OS and that font weight In Gutenberg, the following font families apply: On Windows, Segoe UI is applied, but this font does not support weight
Therefore, there is a larger visual change compared to Mac. Even more confusing are non-Latin languages: Segoe UI doesn't support Japanese, so a separate font is applied for Japanese. If a Japanese font supports weight
If we change the default weight of the |
|
@t-hamano looking at the fallback weight rule, I'd expect a fallback of Would you know why this is not the case? Maybe the browser is trying to interpolate? Or maybe setting the value to |
I expected the same, but for some reason the 600 weight was applied.
It seems to work fine in my environment. If it's
|
|
Awesome. I'll experiment with |
d46430e to
41496e6
Compare
|
I pushed some updates:
@WordPress/gutenberg-design , any other places where we should avoid the new medium font weight? @t-hamano, is text rendering correctly on your machine, for all the font-families used? cc @WordPress/gutenberg-components |
|
Flaky tests detected in 4d795e4. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/18640941543
|
Yes. On Windows OS, font-weight 400 is applied as a fallback as before, so there should be no visual changes. |
|
I would defer to @jameskoster and @jasmussen here as they are close to the system and I want to ensure they give feedback around what should or shouldn't keep medium weight. |
|
The main issue for me was that items in the original Menu component have heavier font-weight than items in the newer menu component. Ideally these are aligned, and both utilise the same weight we see on trunk. I don't have strong feelings about any of the other items highlighted in my previous comment. |
This reverts commit 8f55022.
Additional changes madeFully addressed
Maintained weight in
Maintained weight in
Other affected components (in addition to the ones already listed)
|
| Before | After |
|---|---|
Making <Button variant="link"> heavier means that there will be a weight difference between a standard <a href="#"> and a <Button variant="link" href="#">, which are basically the same thing. @jameskoster Any preferences here? I think it would be simplest for consumers if we maintained a 400 weight for link variant Buttons, regardless of their ultimate markup (button or anchor).
|
@t-hamano As a follow up, I'm wondering if we should just update gutenberg/packages/base-styles/_variables.scss Lines 39 to 40 in fb90cd3
|
Agree! We might consider phasing out the link button variant, it's quite a misleading design imo. |
That's a good idea. Additionally, we might be able to replace the hardcoded weights with SCSS variables and add rules to Stylelint to disallow hardcoded values. |
I tested it again on Storybook, and there should be no visual changes at all on Windows. |
|
I tried to figure out why @t-hamano's Windows browser would use the 600 weight as the fallback when the spec says it should use 400. And found this Chrome bug. Very old, unfixed, and specific to Windows and the Segoe UI font: |


















What?
Related to #64744
Increase the font weight of the
ButtoncomponentWhy?
Using a heavier font-weight gives more prominence to the
Buttoncomponent throughout all variants, and helps to disambiguate buttons from other interactive controls such asInputControlHow?
By changing the
font-weightstyle in theButtoncomponentTesting Instructions
Test the different look in Storybook and in the editor.
Screenshots or screencast
Kapture.2025-07-18.at.17.18.02.mp4