Skip to content
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

Typography > Appearance controls should show available weights only #49090

Closed
Tracked by #60528
jffng opened this issue Mar 15, 2023 · 9 comments · Fixed by #61915
Closed
Tracked by #60528

Typography > Appearance controls should show available weights only #49090

jffng opened this issue Mar 15, 2023 · 9 comments · Fixed by #61915
Assignees
Labels
[Feature] Blocks Overall functionality of blocks [Feature] Font Library [Feature] Typography Font and typography-related issues and PRs [Status] In Progress Tracking issues with work in progress [Type] Bug An existing feature does not function as intended

Comments

@jffng
Copy link
Contributor

jffng commented Mar 15, 2023

What problem does this address?

Currently adding Typography > Appearance controls to a block will render the entire range of font weight (100 - 900), plus their italic options:

Screenshot 2023-03-15 at 11 35 17 AM

Some fonts do not have all of these weights, so unexpected results occur when an Appearance selection is made and the font does not have that weight supplied.

What is your proposed solution?

Would it be possible or a good idea to limit these options to only the weights that are available?

I guess an alternative is to disable entirely the Typography > Appearance controls.

cc @jasmussen @beafialho if you have any thoughts on this, thanks in advance!

@jffng jffng added the [Feature] Typography Font and typography-related issues and PRs label Mar 15, 2023
@jasmussen
Copy link
Contributor

We should definitely limit the dropdown to only available weights and styles. The fact that it isn't seems like a bug, unless I'm missing something.

@cbirdsong
Copy link

This problem was touched on ages ago in #38998, but I never got around to filing it separately. This related issue is also relevant here:

I think this is another good candidate for a set of presets since variable fonts introduce a lot of, uh, potential variation since they go beyond the simple 100-900 scale. However, unlike spacing/font size presets, they would probably need to be constrained by the current font family since that is what would determine if a weight is a valid choice.

In the meantime, I've been simply disabling the Typography > Appearance panel because I don't want to present nonsensical invalid options to editors, especially ones that result in inline CSS.

@Thelmachido Thelmachido added [Type] Bug An existing feature does not function as intended [Feature] Blocks Overall functionality of blocks labels Mar 17, 2023
@hanneslsm
Copy link

hanneslsm commented Aug 11, 2023

The fact that it isn't seems like a bug, unless I'm missing something.

Why is this not a bug? For the regular (not variable) fonts, don't we see which weights are enqueued and just only display them?

I think this is another good candidate for a set of presets since variable fonts introduce a lot of, uh, potential variation

I think we should look at variable fonts separately. They are introducing a lot of other features, not only font-weight.

In the meantime, I've been simply disabling the Typography > Appearance panel because I don't want to present nonsensical invalid options to editors, especially ones that result in inline CSS.

I don't think this is a good option. I'm using semi-bold weights for example very frequently. I'm not using Extra Bold or Black however (and don't have them enqueued), so only they shouldn't be displayed.

@jasmussen
Copy link
Contributor

Why is this not a bug? For the regular (not variable) fonts, don't we see which weights are enqueued and just only display them?

I may have used an odd turn of phrase. I'm suggesting that it is a bug that we show weights that aren't available in the font. I think we are in agreement, but let me know if I misunderstood!

Agreed variable width fonts is something we should support, and is separate. They could even have a separate entry in the dropdown which opened a modal, or even a separate dropdown.

@hanneslsm
Copy link

The fact that it isn't seems like a bug…
I'm suggesting that it is a bug that we show weights that aren't available in the font.

Ah, I misunderstood! Yes, we are in agreement :)

@jffng jffng changed the title Consider limiting Typography > Appearance controls to available weights only Typography > Appearance controls should show available weights only Aug 11, 2023
@creativecoder
Copy link
Contributor

This came up with a theme builder I was working with this week. They selected different font weights and there was no visual change because there weren't font faces defined for those weights.

@colorful-tones
Copy link
Member

I'm adding the newly created [Feature] Font Library label, because I believe there are likely considerations that the underlying architecture will need to account for to surface font weights and even distinguishing variable fonts.

@annezazu annezazu moved this from ❓ Triage to 📥 Todo in WordPress 6.5 Editor Tasks Feb 8, 2024
@colorful-tones
Copy link
Member

colorful-tones commented Feb 13, 2024

Based on a recent Editor Triage async I'm moving this item to the Punted to 6.6 column on the WordPress 6.5 Editor Tasks board.

@colorful-tones
Copy link
Member

Hi folks,
We are only one week away from the Beta 1 cut-off date for WordPress 6.6. This issue hasn’t seen any movement in a while, so we (the editor triage leads of the 6.6 release) have decided to remove it from the WordPress 6.6 Editor Tasks project board.

@github-actions github-actions bot added the [Status] In Progress Tracking issues with work in progress label May 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Blocks Overall functionality of blocks [Feature] Font Library [Feature] Typography Font and typography-related issues and PRs [Status] In Progress Tracking issues with work in progress [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants