[Support request] Download Bottom

Home Forums Support [Support request] Download Bottom

Home Forums Support Download Bottom

Viewing 5 posts - 16 through 20 (of 20 total)
  • Author
    Posts
  • #2433161
    David
    Staff
    Customer Support

    Glad to hear that!

    #2451382
    Chris

    Hi,

    I have the same issue across all 46 of the GeneratePress sites I host: namely, the File Block download button is no longer styled. The only way I can restore the styling is by switching to a different theme or adding bespoke CSS. I’ve tried deactivating all the plugins and this does nothing. It should be noted that the File Block download button used to be styled fine when using the GeneratePress theme.

    Here’s an example where the button is not styled.

    I don’t really want to go through all 46 sites restoring this styling with bespoke CSS.

    Your assistance would be appreciated.

    Thanks,

    Chris

    #2451676
    David
    Staff
    Customer Support

    Hi there,

    WP removed the core block library styles and changed the CSS classes for some of its blocks.
    Which is why those buttons no longer have any colors. Which is really annoying.

    We would need to look at adding the wp-block-file__button or equivalent class to the GP button styles.
    But we would need to do some testing before we can push out a change like that.

    For now the only fix is to add some CSS to resolve that. But if it makes the job less of a chore then this PHP Snippet will add your Customizer Button colors:

    
    function tu_gp_gb_button_styling_css() {
    	$color_settings = wp_parse_args(
    		get_option( 'generate_settings', array() ),
    		generate_get_color_defaults()
    	);
    
        return sprintf(
    		'.wp-block-file__button, .wp-block-file__button:visited {
    			background-color: %1$s;
    			color: %2$s;
    		}
    
    		.wp-block-file__button:hover, .wp-block-file__button:active, .wp-block-file__button:focus {
    			background-color: %3$s;
    			color: %4$s;
    		}',
    		$color_settings['form_button_background_color'],
    		$color_settings['form_button_text_color'],
    		$color_settings['form_button_background_color_hover'],
    		$color_settings['form_button_text_color_hover']
    	);
    }
    
    // Add our CSS to the frontend.
    add_action( 'wp_enqueue_scripts', function() {
    	wp_add_inline_style( 'generate-style', tu_gp_gb_button_styling_css() );
    }, 100 );
    
    // Add our CSS to the editor.
    add_filter( 'block_editor_settings_all', function( $settings ) {
    	$settings['styles'][] = array( 'css' => tu_gp_gb_button_styling_css() );
    
    	return $settings;
    } );
    #2452953
    Chris

    Hi David,

    Thanks very much for the prompt response and the workaround. The only thing missing was the button padding, which I added to the wp-block-file__button styling in your code.

    Are you able to provide an approximate timeframe for pushing out that fix. Just weighing up whether it’s worth waiting.

    Thanks again,

    Chris

    #2454288
    David
    Staff
    Customer Support

    I would like to say soon. But this kind of patch will no doubt lead to other patches that need testing.
    So if you need those styles fixed i would use the snippet for now. Maybe wrap the code in a Plugin to make it easier to deploy ?

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