-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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 Library: Group fonts by source #63211
Conversation
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.
To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
Size Change: +25 B (0%) Total Size: 1.76 MB
ℹ️ View Unchanged
|
packages/edit-site/src/components/global-styles/font-families.js
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Grouping the fonts makes sense to me and I think this is an improvement.
Only two questions:
Wouldn't be better to list the User Fonts first? I'm assuming that if I install some fonts that's because I'm going to 'prefer' them over the theme ones and use them more often. In a way, the Theme Fonts would have less relevance because I installed 'my fonts' to use. As such, I would expect 'my fonts' to be listed first. But yes, it's an assumption, in a way.
Re: naming: how about 'Your Fonts' instead of 'User Fonts'?
Thanks for the review!
I don't have a strong opinion on this one, and I think there are reasonable reasons for either ordering.
I feel like this label makes it unclear which origin the font belongs to, because in the bigger picture, theme fonts might also be considered "Your fonts". I think we need to use one of the words "Installed", "User", or "Custom" to indicate that the font does not belong to the theme font. If we follow a color preset or shadow preset, "Custom Fonts" might be a good choice. |
Thanks for your feedback, I don't have strong opinions as well. However, I'd tend to think the whole concept of 'source' is a little unfriendly for users. |
{ ! hasFonts && ( | ||
<VStack> | ||
<Subtitle level={ 3 }>{ __( 'Fonts' ) }</Subtitle> | ||
<Text as="p">{ __( 'No fonts installed.' ) }</Text> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If there are fonts installed but none of them are active the text, 'No fonts installed' is technically incorrect. Should we replaced this by 'No fonts activated' or add a conditional to render 'activated'/'installed' depending on the availability of base fonts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point. I'd agree that's incorrect but it already happens on trunk. It's not related to this PR.
I'd consider to open a separate issue. With fonts installed but no one activated, the wording should be different. Also, the 'Add fonts' button would be misleading and should be instead the 'Manage fonts' one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will split this to a new issue so that this PR can move on
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems to be working fine.
Should we maintain the same wording as in other parts of the editor and use 'Custom' instead of 'User'? I haven't seem the term 'User' applied to the different origins of the styles across the editor.
Apart from that the word 'fonts' in the origin subtitle (i.e.:'Theme fonts') could be redundant and I haven't seem it used in other parts of the editor for similar settings. Colors and Shadows use just 'Default', 'Theme' and 'Custom'. Probably is good to stick to that to be more consistent with the rest of the UI.
Updated. If we find the term "Custom" confusing, we may need to consider it for all presets: color presets, shadow presets, and font size presets (Font size presets UI is currently under development in #63057). Global Styles SidebarFont Library Modal |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good to me. I think it's ready to go.
Still, I would like this feedback to be addressed before merging:
Apart from that the word 'fonts' in the origin subtitle (i.e.:'Theme fonts') could be redundant and I haven't seem it used in other parts of the editor for similar settings. Colors and Shadows use just 'Default', 'Theme' and 'Custom'. Probably is good to stick to that to be more consistent with the rest of the UI.
* Font Library Sidebar: Group fonts by source * Render text as paragraph * Change "User" to "Custom" Co-authored-by: t-hamano <[email protected]> Co-authored-by: afercia <[email protected]> Co-authored-by: matiasbenedetto <[email protected]> Co-authored-by: jasmussen <[email protected]> Co-authored-by: getdave <[email protected]> Co-authored-by: colorful-tones <[email protected]>
* Revert "Font Library: Group fonts by source (#63211)" * update typography screen description * update screen description Co-authored-by: vcanales <[email protected]> Co-authored-by: t-hamano <[email protected]> Co-authored-by: afercia <[email protected]> Co-authored-by: richtabor <[email protected]>
* Revert "Font Library: Group fonts by source (#63211)" * update typography screen description * update screen description Co-authored-by: vcanales <[email protected]> Co-authored-by: t-hamano <[email protected]> Co-authored-by: afercia <[email protected]> Co-authored-by: richtabor <[email protected]>
…ress#65590) * Revert "Font Library: Group fonts by source (WordPress#63211)" * update typography screen description * update screen description Co-authored-by: vcanales <[email protected]> Co-authored-by: t-hamano <[email protected]> Co-authored-by: afercia <[email protected]> Co-authored-by: richtabor <[email protected]>
WordPress#65590)" This reverts commit 61c26c3.
Closes #58403
Part of #60528
What?
This PR groups fonts by source (
theme
,custom
) in the Global Styles.Why?
How?
The thing I struggled with the most was what label to apply to the source that came from the
custom
source. There are three possible labels:Installed Fonts
,User Fonts
, andCustom Fonts
, but I chose "User Font".At the same time, to improve consistency between the sidebar and the Font Library modal, I've updated the source order to
theme
,custom
. In the Font Library modal, this means that the order will change from Custom, Theme to Theme, Custom.Testing Instructions
Screenshots or screencast