-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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 abbreviations in FontSizePicker
are misleading when the theme declares multiple "small" sizes.
#44245
Comments
Copy-pasting a little conversation from #44247 (comment): jasmussen:
ZebulanStanphill:
|
I don't know of a way. I wouldn't personally mind a way, so long as it isn't the default. |
I also opened another #45268 on this issue. As I mentioned in that issue, here are my two suggestions: Option to force selectboxIf there are more than 6 font size variations, the select box will be displayed and the t-shirt size will not be displayed. Therefore, I believe it would be useful to have an option to force a select box without having to add the necessary variations to make it a select box. Option to change button textIn addition to {
"size": "1.5rem",
"slug": "md",
"name": "Medium",
"shortName": "M"
}
|
I am also having trouble with this issue. |
@t-hamano I quite like both of your solutions. The current system looks pretty in the perfect case when a theme provides only perfect TShirt size font sizes. But is really inflexible and the confusion causes when the labels don't match the values is quite large. Being able to either disable the TShirt sizes altogether and always force the |
I cannot fathom why this was decided to be the default behavior of the size picker. Of course there should be a property enabling us to prefer the drop-down menu. Of course there should be a property that enables us to set the labels our selves for each size. Of course the default size should have a button and be preselected (highlighted) for every new text block. Enlighten me how any of these suggestions would not be ideal for the end user or the developer. ZebulanStanphill:
This is logical and makes a lot more sense than current behaviour. |
Having the same issues. You used to be able to to specify the "ShortName" for the font size but now it now longer works and the labels in the Font Size Control don't match up with what has been set. If you can no longer specify the ShortName, how is it not common sense to simply use the first character of the Name instead when you're generating this control! This following code used to work fine, and now everything is completely messed up!
I don't know how you expect us to build client sites using this editor when something breaks with every single major WP version. Almost 5 years since being in core and it's still not stable enough to give to clients. |
I agree with @maddisondesigns. These labels are really fundamental stuff. And a +1 for a more intuitive reset option (clicking toggles on/off). |
This issue, still... |
Okay, so I just want to verify the situation with this issue. At least two possible solutions, either of which would completely resolve the problem on its own andwhich could both be implemented without conflict, were identified. A working PR which resolved this issue using one of those solutions (manually setting label values) was opened: Five months later, that PR was closed in favor of another solution which would, as described, implement the second option (a prop that forces the dropdown control for <= 5 sizes) but which did not have a PR, branch, or other code specified that would implement this, or a new issue number for discussing it. A third workable solution distinct from the others was proposed here. A PR was accepted for this component that completely rewrote the internal logic regarding the toggle vs. dropdown, but did not while doing so add an override for the toggle/dropdown logic that would've essentially been the second solution referred to above. There is currently no open PR for this issue. There's at least one other open issue that is essentially a duplicate. (That one has had more recent discussion, but this was previously designated to be the primary issue for this topic which is why I'm posting here.) Is there any feasible path to getting this issue addressed? |
I'd really like to see this resolved too, +1 |
Description
The
FontSizePicker
control currently applies abbreviated "t-shirt" labels for the options based solely on their order. This means that the control assumes that the font sizes will start with "small", followed by "medium", "large", "very large", and so on.The problem is that in practice, a theme may actually have two (or perhaps even three" sizes smaller than the default. I actually ran into this recently while trying to create a custom block theme for someone. When using the controls, the option labeled "M" is actually the "small" size, while "S" is the "extra small" size.
Obviously, this is quite confusing.
In prior versions of the editor, the abbreviated labels were merely sequential numbers. So in some sense, the latest versions have introduced a regression here.
Step-by-step reproduction instructions
theme.json
that hasappearanceTools
set totrue
and the followingsettings.typography.fontSizes
set similar to this:Screenshots, screen recording, code snippet
Environment info
Please confirm that you have searched existing issues in the repo.
Yes
Please confirm that you have tested with all plugins deactivated except Gutenberg.
Yes
The text was updated successfully, but these errors were encountered: