Instantly share code, notes, and snippets.

Embed
What would you like to do?
Add basic support for Gutenberg wide align and editor palette colors
/* Add support for wide alignment odf images in Gutenberg */
add_theme_support( 'align-wide' );
/* Add 2 colors palette for the editor in Gutenberg */
add_theme_support('editor-color-palette',
array(
array(
'name' => 'primary color',
'color' => '#02b3e4'
),
array(
'name' => 'secondary color',
'color' => '#09e1c0'
)
)
);
/*
Add style file to gutenberg editor views
*/
function claserama_editor_styles(){
wp_enqueue_style('google-fonts','https://fonts.googleapis.com/css?family=Fira+Sans:400,400i,700','1.0');
wp_enqueue_style( 'claserama-editor-style', get_template_directory_uri() . '/assets/stylesheets/editor-style.css' );
}
add_action('enqueue_block_editor_assets','claserama_editor_styles');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment