- This topic has 1 reply, 2 voices, and was last updated 3 years, 1 month ago by David.
-
AuthorPosts
-
February 23, 2021 at 6:20 am #1669074Communication
Hi there,
I’ve been looking to add my own custom colors to the Gutenberg editor.
But it’s still not working at all :
I can see my custom colors in the editor, but when selected, I can only see the change with the new color in the editor, but it’s not changing on the website (no cache).
And it’s working alright if I type another color code like #333333.
But not when trying to pick my own custom colors !I’ve tried using those bit of codes in the function.php of my child theme :
– David’s code here : https://generatepress.com/forums/topic/feature-request-add-commonly-used-colours-to-colour-palette/#post-1410261
– This one https://developer.wordpress.org/block-editor/developers/themes/theme-support/
– And even this last one :<?php function mytheme_setup_theme_supported_features() { add_theme_support( 'editor-color-palette', array( array( 'name' => 'blue', 'slug' => 'blue', 'color' => '#48ADD8' ), array( 'name' => 'pink', 'slug' => 'pink', 'color' => '#FF2952' ), array( 'name' => 'green', 'slug' => 'green', 'color' => '#83BD71' ), array( 'name' => 'yellow', 'slug' => 'yellow', 'color' => '#FFC334' ), array( 'name' => 'red', 'slug' => 'red', 'color' => '#B54D4D' ), array( 'name' => 'grey', 'slug' => 'grey', 'color' => '#f8f8f8' ), array( 'name' => 'ui', 'slug' => 'ui', 'color' => '#232634' ), array( 'name' => 'ui-dark', 'slug' => 'ui-dark', 'color' => '#2F3344' ), array( 'name' => 'ui-light', 'slug' => 'ui-light', 'color' => '#575D74' ), ) ); } add_action( 'after_setup_theme', 'mytheme_setup_theme_supported_features' );
Still exactly the same problem with all 3. What am I missing ?
Thanks a lot for your help !February 24, 2021 at 2:40 am #1670356DavidStaffCustomer SupportHi there,
your original topic slipped past our system, so I apologise for the late response,
the editors core color palette doesn’t support RGBA … you should still find its available in the GenerateBlocks plugin, where it is supported such as a Container Background.
And to the main issue … you also have to add CSS Styles for the front end – see here:
https://developer.wordpress.org/block-editor/developers/themes/theme-support/#block-color-palettes
Or you may find the Central Color Palette plugin is a simpler method to managing this.
-
AuthorPosts
- You must be logged in to reply to this topic.