[Resolved] Customizing GenerateBlocks Color Palette

Home Forums Support [Resolved] Customizing GenerateBlocks Color Palette

Home Forums Support Customizing GenerateBlocks Color Palette

Viewing 12 posts - 16 through 27 (of 27 total)
  • Author
    Posts
  • #1433186
    Philip

    Hello
    Sorry to renew the topic, but i need help with same colors in Gutenberg blocks, i wanted to add my own colors and used the provided code by Tom plus additional ones i created, they work on back end but do not apply in the front end when the post is published same thing happen if i edit an old post and select from my new colors, they don’t apply on front end when post is updated, just black text and no color.
    What can be the problem?
    Thank you.

    #1433534
    David
    Staff
    Customer Support

    Hi there,

    can you start a new topic and share a link to a page where the problem is.

    #1484648
    David

    The code you gave replaces the colour palette. Could you provide to code to just add colours to the palette, leaving the previous colours there?

    add_action( 'after_setup_theme', function() {
        add_theme_support( 'editor-color-palette', array(
            array(
                'name'  => __( 'Blue' ),
                'slug'  => 'blue',
                'color' => '#59BACC',
            ),
            array(
                'name'  => __( 'Green' ),
                'slug'  => 'green',
                'color' => '#58AD69',
            ),
            array(
                'name'  => __( 'Orange' ),
                'slug'  => 'orange',
                'color' => '#FFBC49',
            ),
            array(
                'name'  => __( 'Red' ),
                'slug'  => 'red',
                'color' => '#E2574C',
            ),
        ) );
    } );
    #1485188
    Leo
    Staff
    Customer Support

    I don’t believe so. You’d need to add the original colors along with the new colors in the code.

    #1656691
    Rachel

    Hi,

    what a great thread. Thanks so much for this.

    Is there a code which I can add transparency to the Generatepress customiser? Thanks.

    Sorry, all fine the slider is there

    #1657226
    Leo
    Staff
    Customer Support

    Glad you found it πŸ™‚

    #1763172
    Sascha

    When adding to code snippets or child themes functions.php, the color-palette in Customizer remains unchanged πŸ™

    #1763389
    David
    Staff
    Customer Support

    Hi there,

    for the Customizer Colors you need to use the snippet provided here:

    https://docs.generatepress.com/article/generate_default_color_palettes/

    #1842679
    William

    Aloha πŸ™‚

    The GenerateBlocks Color Palette code works great to color GenerateBlocks (containers, headlines).

    But it seems to kill the ability to color a non-GenerateBlocks stuff, for example, a WP Paragraph block.

    I’d rather not have to convert all my WP Paragraph blocks to GB Headlines (paragraph) .. what a chore.

    Can the code be adjusted to apply to items outside the GB-sphere?

    Oddly enough … I can color (with code above) a WP Paragraph block in editing mode … but doesn’t show up live.

    https://jumpshare.com/v/21IVBsgJfxmr2ldbLz3I

    Happy Friday!

    πŸ™‚

    #1843634
    Tom
    Lead Developer
    Lead Developer

    Hi there,

    Core blocks use the class system to style themselves (GB uses dynamic CSS). So, you’ll need to add those classes to the your site stylesheet. For example:

    .has-myred-color {
        color: red;
    }

    Hope this helps!

    #1843693
    William

    I would NEVER have figured that out!

    You are indeed the best πŸ™‚

    Mahalo to all at GP!

    Bill

    #1844527
    Tom
    Lead Developer
    Lead Developer

    Glad I could help! πŸ™‚

Viewing 12 posts - 16 through 27 (of 27 total)
  • You must be logged in to reply to this topic.