Skip to content

Instantly share code, notes, and snippets.

@mishterk
Last active October 14, 2019 09:57
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 mishterk/2ffa3384a8640113e30547719f1a066e to your computer and use it in GitHub Desktop.
Save mishterk/2ffa3384a8640113e30547719f1a066e to your computer and use it in GitHub Desktop.
How to define custom colour palette for Gutenberg; the new WordPress block editor. More info see https://philkurth.com.au/tips/how-to-customize-the-colour-palette-for-wordpress-gutenberg-block-editor/
<?php
add_action( 'after_setup_theme', function () {
add_theme_support( 'editor-color-palette', [
[
'name' => 'Purple',
'slug' => 'purple',
'color' => '#2B265C'
],
[
'name' => 'Mauve',
'slug' => 'mauve',
'color' => '#915099'
],
[
'name' => 'Charcoal',
'slug' => 'charcoal',
'color' => '#222222'
],
] );
} );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment