[Resolved] Integration between GeneratePress Customizer and GenerateBlocks Global Styles?

Home Forums Support [Resolved] Integration between GeneratePress Customizer and GenerateBlocks Global Styles?

Home Forums Support Integration between GeneratePress Customizer and GenerateBlocks Global Styles?

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #1672899
    Whelan

    Hi, I use the GP Premium Colors Module and the free version of GenerateBlocks. In my experience, the default GP Block button does not pick up the style I set in the Customizer – which is disappointing. Is there any more integration in the Pro version of GBlocks? i.e. is Global Styles synced with the GP Premium colors?

    customizer screenshot

    #1672928
    Leo
    Staff
    Customer Support
    #1673439
    Whelan

    screenshot

    Thanks, yes, that’s almost perfect! I added some border styles and everything’s working apart from the background color – it does not appear in editor mode. The css is not carried over correctly from GP to GB (see my screenshot of the inspector). Perhaps this is because it is semi-opaque RGBA? If I change it to a solid color, it works, but is there a way to use colors with alpha?

    I see that GB handles background differently:

    'backgroundColor' => '',
    'backgroundColorOpacity' => 1,

    However, what I ideally want is to control color and opacity via the GP Color Customizer interface.

    My code (added as a snippet):

    add_filter( 'generateblocks_defaults', function( $defaults ) {
        $color_settings = wp_parse_args(
            get_option( 'generate_settings', array() ),
            generate_get_color_defaults()
        );
    
        $defaults['button']['backgroundColor'] = $color_settings['form_button_background_color'];
        $defaults['button']['backgroundColorHover'] = $color_settings['form_button_background_color_hover'];
        $defaults['button']['textColor'] = $color_settings['form_button_text_color'];
        $defaults['button']['textColorHover'] = $color_settings['form_button_text_color_hover'];
    	$defaults['button']['borderColor'] = 'inherit';
    	$defaults['button']['borderSizeTop'] = '2px';
        return $defaults;
    } );
    #1674169
    Tom
    Lead Developer
    Lead Developer

    Are your GP buttons using opacity? If so, that’s likely the issue here.

    Work definitely needs to be done in this area, as GB takes a hex color and an opacity value and creates an rgba value for you. Not ideal, one of the things I dislike about GB at the moment.

    This is something I’ll likely tackle in the next feature release – removing the opacity value and allowing the rgba value directly.

    #1674205
    Whelan

    Yes opacity is the problem. GP Premium Customizer Color settings are inconsistent with GB settings. It would also be good if there was a border setting in the customiser.

    I look forward to a feature release…. but the filter is fine for now. Thanks

    #1675263
    Tom
    Lead Developer
    Lead Developer

    Agreed – will get it done 🙂

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