-
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: design updates #36545
Comments
If I'm not mistaken, we are not showing the segmented controls because of two problems related to the theme.json:
The first problem will require some design changes to show that those two values contain custom values. The second one could be fixed in code. I'll provide a design slightly based on my proposed solution for this issue |
Here's a couple of ideas: The first one is more complicated technically (and maybe impossible to do). It would require calculating a value (in the case of a The second idea is easier to implement: we simply show the initial letter of the name. In case two labels start with the same name, we could append a number (L1, L2). |
@kellychoffman for the font size hints with decimal points, I already have a PR ready for that, just needs final approval: #36420 Obviously a more technical solution for calculating values that include |
@javierarce, I'm moving this issue back to the To-do column. The "Needs Review" is mainly for PRs. |
Oh, thanks @Mamaduka, I didn't know that! 😓
The only problem I see with that approach (showing a number that was dynamically calculated without any indication of its nature) is that a user could select 48, visit the site and see a totally different size. Also, the result of calculating the dynamic value could be smaller or equal to any of the fixed values. So that's why I think it's important to indicate when those values are calculated.
True. The all-initials approach makes more sense to me, although I would still indicate that L & H are dynamic on the hint label. I guess that the logic for the segment control would then be this one:
Also, maybe the theme.json file could also have a property to force the second mode. |
This cannot be done, because now we don't have a way of calculating dynamic values (css vars, clump, etc...). So if we have at least one such value we show the The proper solution is to calculate the dynamic values which is not really simple. @jorgefilipecosta I think had some PR about this.. An alternative would be to show a segmented control with labels, but this will need to take into account other things, because these labels could be too big and make the control incomprehensible, as we have limited space in
Both these values ( |
Devil's advocate here, sorry 😉 Given the complexity of displaying a value that would be recognizable to the user, perhaps 5.9 just sticks with the dropdown regardless of the amount of Font Sizes registered? With a few minor tweaks to the "hits", as discussed here #36420, I personally think that would be sufficient. The dropdown may not be perfect, but it is easy grok with the clear names "Small, Medium, Large, etc.", especially for newer users. |
Agree here. At first my mind turned to select controls with a "Please select" item at the top of the options list. Selecting that option after having already chosen a font size would, I imagine, have the same effect as the current "Default". The "Default" label, at least, communicates what is going to happen when we select it. Unless... the "Please select" item only appears after unsetting via a "Reset" button (?). |
There's an alternate approach in #36636 that builds upon the work by @ndiego in #36420. I kept it as a separate PR in case I was on the wrong track. The PR linked:
|
I've thrown up an attempt to show tooltips on the ToggleGroupControlOption in #36726. Adding to Needs Review column as well. |
I'll have a PR about this today with an approach we can discuss. |
The main item that's important for 5.9 is #37038, so once that is merged we can consider this concluded for 5.9. Further improvements can land later. |
As we (@ntsekouras and I) talked on a call, it is not possible to calculate all the dynamic values reliably. They may depend on the device of the viewer etc... We can, and ideally should correctly display some dynamic values like CSS variable references that were defined on theme.json. I think if a font-size is set to "clamp(1.8rem, 2.5vw, 2.8rem)" our UI should show something useful to most users e.g., "Large" or "L". But ideally, an advanced user could see in a raw text field the font size is "clamp(1.8rem, 2.5vw, 2.8rem)" and be able to make adjustments. |
I think all the related PRs here got merged. Should we close this one? |
Hi, @aaronrobertshaw , I want to suggest that instead of just showing dynamic text for "clamp(1.8rem, 2.5vw, 2.8rem)" type of font size, I think it should show min max or either just the max value together with it, something like "Dynamic - 2.8rem)" because, currently it become difficult to get idea what font size text is taking. |
👋 - the use cases can vary a lot like |
@ntsekouras , then I suggest, show font size as tooltip on hover and it should simply display the value we exactly put in the theme.json file, or from global settings. |
That was the reason behind these changes. Do you think it would be helpful to show for example |
In case of variable, we can show the value of variable , (for example --wp--preset--font-size--my-font-size: 2rem; should show 2rem for var(--wp--preset--font-size--my-font-size), but in case of any fixed value, like 2rem, 12px, clamp(16px, 2vw, 20px) etc, it should show exact the same value as provided. for common person it gives the idea how the font size is taking its value. |
Thanks for the suggestions and thoughts @uniquesolution, they are appreciated 👍 I think I am still leaning towards omitting any additional information that could confuse average users. The majority of users would not understand There was some discussion on one of the PRs related to this, that might shine some light on how we ended up with the current behaviour. If you are interested in putting together a proof of concept PR with any further ideas I'd be more than happy to help review! |
Design updates needed for 5.9
Design updates proposed for 5.9
The text was updated successfully, but these errors were encountered: