Skip to content

Instantly share code, notes, and snippets.

@machelinos
Last active August 7, 2018 17:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save machelinos/5219a03921a08523024eab0603c39f4c to your computer and use it in GitHub Desktop.
Save machelinos/5219a03921a08523024eab0603c39f4c to your computer and use it in GitHub Desktop.
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