WordPress / gutenberg

The Block Editor project for WordPress and beyond. Plugin is available from the official repository.
https://wordpress.org/gutenberg/
Other
10.32k stars 4.12k forks source link

Font size presets UI: Allow renaming of theme sizes #64054

Open ndiego opened 1 month ago

ndiego commented 1 month ago

What problem does this address?

The Font size presets UI is fantastic, and I reviewed this feature with community members during Build Mode with @bgardner last week.

One feature request that came up was the ability to rename the theme sizes. This would not change the underlying slug, just the visual name powered by the name property. Perhaps the implementation could look like the custom font size preset option.

image

Being able to rename the font sizes would allow the user to provide more descriptive or accurate names, depending on their situation. This functionality is also available in theme.json so the more we can map theme.json to the Global Style UI, the better.

What is your proposed solution?

Add the ability to rename theme font sizes, just like you can with custom font size presets.

cc @matiasbenedetto @mikachan

t-hamano commented 1 month ago

When the font size preset UI was being developed, initially it was possible to rename theme presets as well. But I suggested that theme presets should not allow renaming of presets to keep consistency with other presets (See this comment).

If we are going to allow renaming of theme presets, I think we should at least apply the same approach to shadow presets.

One concern I have is that when there are 5 or fewer preset sizes, the UI is a button group with t-shirt size labels instead of a dropdown, while the preset labels are displayed as tooltips.

If users are able to rename the presets, I'm concerned that there could be a mismatch between the button labels and the tooltip labels.

image

However, this issue can also occur if the theme developer hasn't provided the proper slugs and labels.

For more information on this issue, see #44245.

ndiego commented 1 month ago

If we are going to allow renaming of theme presets, I think we should at least apply the same approach to shadow presets.

Good callout. Consistency is key, whatever we ultimately decide.