Site logo

Archived topic

CSS is suddenly off, and I don’t understand why

5 replies · Started by Lars on December 15, 2022

Viewing posts 1–6 of 6

I am working on https://bywildera.com and started noticing that CSS behaved weird. If you check the front page this is the result I get and I don’t know why (look at the buttons especially):

Hi Lars,

As we don't know what it is supposed to be looking like, can you give an example?

Does the editor look correct? If so, can you take a screenshot of the editor?

Sorry about that! Here you go:

I have added this as a code snippet and wonder if it can have impact?

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']['paddingTop'] = '15';
    $defaults['button']['paddingRight'] = '20';
    $defaults['button']['paddingBottom'] = '15';
    $defaults['button']['paddingLeft'] = '20';

    return $defaults;
} );

It only happens now and then that the buttons start acting weird. Another thing that happens with them is that the alignment goes to the left (flex-start), but only occassionaly on a refresh of the page, and then after a while it goes back to center (flex-center).

Hi Lars,

That code shouldn't cause such an issue.

I tried viewing that page, and it's displaying correctly from my end.

It's likely that this is somewhat of a caching issue. The first likely one is Browser caching since I can't replicate the issue from my end.

In saying "It only happens now and then", when and if it reoccurs, can you try viewing it from a different browser to test?

Let us know how it goes.

This archived topic is closed to new replies.