Site logo

[Resolved] Custom Colour Palette Options Not Displaying On Page

Home Forums Support [Resolved] Custom Colour Palette Options Not Displaying On Page

Home Forums Support Custom Colour Palette Options Not Displaying On Page

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1745788
    Kim

    Hi guys,

    After following Tom’s advice on this post I added some custom colours to our site’s palette:
    https://generatepress.com/forums/topic/customizing-generateblocks-color-palette/#post-1200829

    Unfortunately the colours do not come into effect on the front end at the moment. I can see the element gains the class ‘has-color-green’ etc. but no styling is associated to it.

    Here’s the code I added to my functions.php file:

    function mytheme_setup_theme_supported_features() {
    add_theme_support( ‘editor-color-palette’, array(
    array(
    ‘name’ => __( ‘GRG Dark Green’, ‘themeLangDomain’ ),
    ‘slug’ => ‘grg-dark-green’,
    ‘color’ => ‘#094B3B’,
    ),
    array(
    ‘name’ => __( ‘GRG Green’, ‘themeLangDomain’ ),
    ‘slug’ => ‘grg-green’,
    ‘color’ => ‘#2D9F73’,
    ),
    array(
    ‘name’ => __( ‘GRG Navy’, ‘themeLangDomain’ ),
    ‘slug’ => ‘grg-navy’,
    ‘color’ => ‘#212531’,
    ),
    array(
    ‘name’ => __( ‘GRG Cornforth’, ‘themeLangDomain’ ),
    ‘slug’ => ‘grg-cornforth’,
    ‘color’ => ‘#e1ddd4’,
    ),
    array(
    ‘name’ => __( ‘GRG Mint’, ‘themeLangDomain’ ),
    ‘slug’ => ‘grg-mint’,
    ‘color’ => ‘#C4D0CA’,
    ),
    ) );
    }

    add_action( ‘after_setup_theme’, ‘mytheme_setup_theme_supported_features’ );

    Many thanks for your help!

    #1746762
    David
    Staff
    Customer Support

    Hi there,

    you have to add the CSS styles to your style sheet as well.
    See Tom’s reply(ies) here for an example:

    https://generatepress.com/forums/topic/changing-default-colors-in-color-picker/#post-1664886

    #1749043
    Kim

    Thanks David!

    #1749264
    David
    Staff
    Customer Support

    You’re welcome

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.