Last active
October 11, 2023 13:50
-
-
Save zgordon/ce88e48b51bebbb87830290247a02e37 to your computer and use it in GitHub Desktop.
This example shows how to use enqueue_block_assets to enqueue custom block CSS on the frontend of a theme and in the Gutenberg editor.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Enqueue block styles on frontend and in editor | |
* | |
*/ | |
function mytheme_block_styles() { | |
wp_enqueue_style( 'mytheme-blocks', get_stylesheet_directory_uri() . '/css/blocks.css' ); | |
} | |
add_action( 'enqueue_block_assets', 'mytheme_block_styles' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thank you! It helped me to add a font family to the Gutenberg editor iframe for mobile and tablet preview.
👍