- This topic has 19 replies, 5 voices, and was last updated 1 year, 4 months ago by David.
-
AuthorPosts
-
November 25, 2022 at 7:48 am #2433161DavidStaffCustomer Support
Glad to hear that!
December 6, 2022 at 5:05 am #2451382ChrisHi,
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
December 6, 2022 at 8:12 am #2451676DavidStaffCustomer SupportHi 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; } );
December 7, 2022 at 5:46 am #2452953ChrisHi 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
December 8, 2022 at 3:20 am #2454288DavidStaffCustomer SupportI 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 ? -
AuthorPosts
- You must be logged in to reply to this topic.