2

I need to have the client's theme colors here so he doesn't have to remember the color codes each time he's using them.

enter image description here Is

is there any way to Add/Remove/Change some colors from the default "Paragraph" block color settings side panel?

Thank you in advance!

1

Rather than adjusting the default palette, you can define (and enforce) a custom palette.

<?php
// Add a custom palette
add_action( 'after_setup_theme', 'wpse_block_color_palette' );
function wpse_block_color_palette() {
    add_theme_support(
        // Define the colors
        'editor-color-palette', array(
            // First color - black
            array(
                'name'  => esc_html__( 'Black', 'textdomain' ),
                'slug' => 'black',
                'color' => '#2a2a2a',
            ),
            // Second color - blue
            array(
                'name'  => esc_html__( 'Blue', 'textdomain' ),
                'slug' => 'blue',
                'color' => '#0000ff',
            )
            // And so on and so forth
        )
    );
}
?>

You'll then want to add styling for the classes they'll generate. The palette applies to any block with core styling, which boils down to "has-(slug)-background-color" and "has-(slug)-color".

.has-black-background-color {
     background-color: #000;
 }
.has-black-color {
     color: #000;
}
.has-blue-background-color {
     background-color: #00f;
}
.has-blue-color {
     color: #00f;
}
| improve this answer | |
0

You can use a color palette plugin. Here is a google search for the query WordPress palette

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.