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

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

Open
ndiego opened this issue Jul 29, 2024 · 4 comments
Open

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

ndiego opened this issue Jul 29, 2024 · 4 comments
Labels
Global Styles Anything related to the broader Global Styles efforts, including Styles Engine and theme.json [Type] Enhancement A suggestion for improvement.

Comments

@ndiego
Copy link
Member

ndiego commented Jul 29, 2024

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

@ndiego ndiego added [Type] Enhancement A suggestion for improvement. Global Styles Anything related to the broader Global Styles efforts, including Styles Engine and theme.json labels Jul 29, 2024
@t-hamano
Copy link
Contributor

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
Copy link
Member Author

ndiego commented Jul 29, 2024

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.

@richtabor
Copy link
Member

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.

Would be cool if you could modify those t-shirt sizes too I suppose.

@matiasbenedetto
Copy link
Contributor

Would be cool if you could modify those t-shirt sizes too I suppose.

I think this comment, #46586 (comment), condenses several reasons why renaming could be problematic. Despite being implemented some time ago, the option to rename the short names was dismissed in favor of using a flag to enable/disable the shirt size control instead of a select component. None of the alternatives covers all possible use cases, though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Global Styles Anything related to the broader Global Styles efforts, including Styles Engine and theme.json [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

No branches or pull requests

4 participants