Automattic / default-small-business-theme

GNU General Public License v2.0
10 stars 7 forks source link

Change editor font enqueue from inline to an action hook #11

Closed crunnells closed 5 years ago

crunnells commented 5 years ago

While poking around in the editor styles, I noticed that external font resources are being enqueued via @import from editor.css. A better, more portable solution, would be to enqueue it in functions.php via similar code:

/**
 * Gutenberg Editor Styles
 */
function business_theme_editor_styles() {
    wp_enqueue_style( 'business-theme-fonts', business_theme_fonts_url() );
    wp_enqueue_style( 'business-theme-editor-block-style', get_template_directory_uri() . '/editor.css' );
}
add_action( 'enqueue_block_editor_assets', 'business_theme_editor_styles' );

That should enqueue any external font resources that were defined in business_theme_fonts_url()

crunnells commented 5 years ago

Fixed in 39a9fea89da3e02a616f20f3ac5629ea3249e9ab