-
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
Command Palette: add command to open fonts #54880
Comments
@annezazu It strikes me that if the Font Library is going to land in 6.5 - that this would be a good one to squeeze in as well. |
Agreed! @mikachan & @matiasbenedetto for consideration. |
Thanks for the ping. It would be very nice to add this 👍 |
Agreed, this would be a super cool addition! |
I had a try at this, but was unable to find a way to open not only the modal, but also the typography panel. In comparison, (simplified) the custom CSS, stylebook and preference modal commands work because these are separate screens with their own paths. |
Thanks for taking a look at this, @carolinan. Maybe we need to use a different kind of trigger to open the Font Library modal, something that's more similar to the preference modal. (I say all this without looking into the details yet.) |
Just to be sure, is this command expected to open the Font Library modal itself, rather than opening the Global Styles typography panel? If so, I think we need to manage the modal's state with a datastore. I'm testing it with #58350. |
Yes, I think opening the modal makes the most sense. Thanks for testing a solution for this! Managing the modal's state with the datastore sounds like a good step forward. |
I think it should do both. |
After some simple hacking and testing of existing command actions, it seems possible to open the Typograph panel with a command action. I would like to proceed with #58350. Diffdiff --git a/packages/edit-site/src/components/global-styles/ui.js b/packages/edit-site/src/components/global-styles/ui.js
index 3abd1c811f..c59c7caee3 100644
--- a/packages/edit-site/src/components/global-styles/ui.js
+++ b/packages/edit-site/src/components/global-styles/ui.js
@@ -246,6 +246,9 @@ function GlobalStylesEditorCanvasContainerLink() {
case 'global-styles-revisions:style-book':
goTo( '/revisions' );
break;
+ case 'global-styles-typograpy':
+ goTo( '/typography' );
+ break;
case 'global-styles-css':
goTo( '/css' );
break;
diff --git a/packages/edit-site/src/hooks/commands/use-common-commands.js b/packages/edit-site/src/hooks/commands/use-common-commands.js
index fdea50d8af..e61365572d 100644
--- a/packages/edit-site/src/hooks/commands/use-common-commands.js
+++ b/packages/edit-site/src/hooks/commands/use-common-commands.js
@@ -202,8 +202,8 @@ function useGlobalStylesOpenCssCommands() {
return [
{
- name: 'core/edit-site/open-styles-css',
- label: __( 'Customize CSS' ),
+ name: 'core/edit-site/open-font-library-modal',
+ label: __( 'Open font library' ),
icon: brush,
callback: ( { close } ) => {
close();
@@ -217,7 +217,7 @@ function useGlobalStylesOpenCssCommands() {
setCanvasMode( 'edit' );
}
openGeneralSidebar( 'edit-site/global-styles' );
- setEditorCanvasContainerView( 'global-styles-css' );
+ setEditorCanvasContainerView( 'global-styles-typograpy' );
},
},
]; 12b2126f2f1476f64f51b1e467ac7a8b.mp4 |
Agreed. |
As seen in #58350 (comment), refactoring (removing) the context is necessary to move this issue forward. I have submitted #58428, but if anyone is interested, please join. |
In order to add the command using the ideal approach, #58428 would need to be resolved first. This command is not originally on the roadmap and I don't think it's essential to include it in WP6.5, so I'll punt it to 6.6. |
Today I was playing around looking for the modal in 6.5 beta 2 ... And I didn't easily find it. Now, does this mean that the font library is only here for FSE themes? Is it ever coming to non FSE themes? Also, I expected it to be in the block options but don't know if that's the best idea. |
Hi folks, |
Pulled from the FSE Outreach Program's Final Touches call for testing:
In checking, there is not a command in place for opening the font management and it seems wise to add in. At the minimum, a "Open font management" command, similar to "Open styles".
The text was updated successfully, but these errors were encountered: