- This topic has 10 replies, 2 voices, and was last updated 3 years, 1 month ago by Tom.
-
AuthorPosts
-
February 16, 2021 at 12:26 am #1659894Rachel
Hi,
are you implementing a custom color palette to the theme, Gutenberg and Generateblocks, too?
I am using two code snippets now but in the customiser I am missing the
a) transparency and
b) if I click inside Gutenberg to change the color of a single word of a paragraph it does change the whole sentence instead of only one word.
c) I prefer to use in posts the normal Gutenberg editor instead of Generateblocks (I use it only in pages and with the block element.February 16, 2021 at 11:11 am #1660774TomLead DeveloperLead DeveloperHi there,
We’re working on a global color feature in GP and GB.
What code snippets are you using, currently?
How are you adding the color? I believe you need to use the block toolbar to color individual words – not the features in the sidebar.
February 19, 2021 at 12:27 am #1664056RachelHi,
Thanks Tom. Really great to hear that you are working on it.
Watched Leo’s video today with the dynamic stuff.
Really good- I love your way of thinking.
I am using code snippets and I posted the code in from one of your posts. I run it only in the Admin area.
I was trying to use the generateblocks colour selection but that didn’t work so I used the Gutenberg one that works but it would be cool to use it in generateblocks…
Thank you
February 19, 2021 at 11:02 am #1664898TomLead DeveloperLead DeveloperStrange, it should work in GenerateBlocks, but it depends on the exact snippet. Feel free to link me to it and I’ll take a look.
Thanks for the kind words! Lots of cool things on the way 🙂
February 21, 2021 at 8:07 am #1666668RachelHi, this is the code I have put in the snippets plugin.
This for the customizer:
add_filter( ‘generate_default_color_palettes’, ‘tu_custom_color_palettes’ );
function tu_custom_color_palettes( $palettes ) {
$palettes = array(
‘#666666’,
‘#FFFFFF’,
‘#000000’,
‘#CCABC1’,
‘#F2E3E3’,
‘#D09100’,
);return $palettes;
}and this one
add_action( ‘after_setup_theme’, function() {
add_theme_support( ‘editor-color-palette’, array(
array(
‘name’ => __( ‘Dove Gray’ ),
‘slug’ => ‘dove gray’,
‘color’ => ‘#666666’,
),
array(
‘name’ => __( ‘White’ ),
‘slug’ => ‘white’,
‘color’ => ‘#FFFFFF’,
),
array(
‘name’ => __( ‘Lily’ ),
‘slug’ => ‘lily’,
‘color’ => ‘#CCABC1’,
),
array(
‘name’ => __( ‘Dawn Pink’ ),
‘slug’ => ‘Dawn Pink’,
‘color’ => ‘#F2E3E3’,
),
array(
‘name’ => __( ‘Buddha Gold’ ),
‘slug’ => ‘Buddha Gold’,
‘color’ => ‘#D09100’,
),
array(
‘name’ => __( ‘Strikemaster’ ),
‘slug’ => ‘Strikemaster’,
‘color’ => ‘#8E6480’,
),
array(
‘name’ => __( ‘Bermuda’ ),
‘slug’ => ‘Bermuda’,
‘color’ => ‘#7DBBC3’,
),
) );
} );February 21, 2021 at 8:13 am #1666677RachelOh, it works to select it but it doesnt take the color – I need to go to custom color and it is selected but I need to press return – than it works.
February 21, 2021 at 10:43 am #1666821TomLead DeveloperLead DeveloperAnd that makes it work on the front-end as well?
One thing I’m noticing is the capital letters/spaces in your
slug
values. Make sure to keep it lowercase with dashes instead of spaces. SoDawn Pink
becomesdawn-pink
.February 23, 2021 at 10:18 pm #1670150RachelThank you I just wait when it is finished in Generateblocks and Generatepress.
Do you have a rough idea when to release it?
Thank you.
February 24, 2021 at 10:36 am #1671027TomLead DeveloperLead DeveloperSince you’re using this with a core paragraph block, it’s not likely something that will be fixed in GP/GB – it should just work out of the box.
February 25, 2021 at 11:36 pm #1673226RachelThank you Tom
February 26, 2021 at 9:20 am #1674064TomLead DeveloperLead DeveloperNo problem!
-
AuthorPosts
- You must be logged in to reply to this topic.