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 Picker: Refine, show font preview, and load only active fonts from library #51151

Closed
jasmussen opened this issue Jun 1, 2023 · 11 comments · Fixed by #67118
Closed

Font Picker: Refine, show font preview, and load only active fonts from library #51151

jasmussen opened this issue Jun 1, 2023 · 11 comments · Fixed by #67118
Assignees
Labels
[Feature] Design Tools Tools that impact the appearance of blocks both to expand the number of tools and improve the experi [Feature] Font Library [Feature] UI Components Impacts or related to the UI component system [Status] In Progress Tracking issues with work in progress [Type] Enhancement A suggestion for improvement.

Comments

@jasmussen
Copy link
Contributor

Extracted from #45271.

The font picker will show fonts that are registered in theme.json. As detailed in #45271, that means fonts added to your library which are active. The font picker can look like this:

Selecting fonts in Post Editor

The above design is an enhancement that focuses on showing a preview of the font itself, inline in the picker. But this design should not block either the webfonts API from landing, nor the font manager. The existing picker can work fine in the same system:

existing picker
@jasmussen jasmussen added [Type] Enhancement A suggestion for improvement. [Feature] UI Components Impacts or related to the UI component system [Feature] Design Tools Tools that impact the appearance of blocks both to expand the number of tools and improve the experi labels Jun 1, 2023
@mtias
Copy link
Member

mtias commented Aug 2, 2023

Is this being handled as part of the Fonts UI work?

@jasmussen
Copy link
Contributor Author

Initially that was my instinct, but in order to separate concerns I split it out. Happy to consolidate again, though?

@mtias
Copy link
Member

mtias commented Aug 3, 2023

It's ok to have it split as long as we don't lose track of it!

@jasmussen
Copy link
Contributor Author

Right! @mikachan is #52698 a good tracking issue to include this one on? Or is there a better one?

@mikachan
Copy link
Member

mikachan commented Aug 3, 2023

Yeah, I think #52698 would be a good fit for this. I think it fits into the scope of that issue and I don't think there are any other, better tracking issues 😄

@annezazu
Copy link
Contributor

I just ran into this while working on a site for someone and found the lack of previews to be so frustrating. I couldn't remember exactly what each font looked like after installing a few and it resulted in a lot of unnecessary back and forth. In handing off the site to the person, it made me wish there was a preview to save them time too when they take it over.

This is a long winded way of saying consider it a plus 1 to see this iterated on.

@matiasbenedetto
Copy link
Contributor

matiasbenedetto commented Nov 19, 2024

I implemented a potential fix #67118 using styling and on the native HTML select component rendered by the FontFamilyControl.

It works as expected on chromium-derived browsers (Chrome, Edge, Brave, etc). There's a known bug in Firefox that makes the browser ignore the style properties in <option> tags. I haven't tried it on Safari.

As alternative to the native solution a custom select component that emulates the native select control could be implemented but I think that's much more complex and could impact accesibility .

@WordPress/gutenberg-components input is appreciated.

@mirka
Copy link
Member

mirka commented Nov 19, 2024

@matiasbenedetto Have you considered using CustomSelectControl? Those can be styled, and is already being used in similar things like the Appearance select in the Typography controls.

@matiasbenedetto
Copy link
Contributor

@matiasbenedetto Have you considered using CustomSelectControl? Those can be styled, and is already being used in similar things like the Appearance select in the Typography controls.

Ohh I didn't know about that component. I will update the PR using it. Thanks for the input @mirka !

@annezazu
Copy link
Contributor

So excited to see this!

@mtias
Copy link
Member

mtias commented Nov 21, 2024

Cool to see progress here!

@matiasbenedetto matiasbenedetto moved this from Needs development to Needs review in Polish Nov 21, 2024
@github-project-automation github-project-automation bot moved this from Needs review to Done in Polish Nov 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Design Tools Tools that impact the appearance of blocks both to expand the number of tools and improve the experi [Feature] Font Library [Feature] UI Components Impacts or related to the UI component system [Status] In Progress Tracking issues with work in progress [Type] Enhancement A suggestion for improvement.
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

6 participants