Support » Theme: Astra » astra-theme-css-inline-css

  • There is a lot of inline CSS being added to my site. Maybe I’m overlooking it, but is there a place in the site options/customizer where some of these values can be adjusted? I know I can add my own CSS but if there’s a place to modify these values from within WordPress so that the generated inline CSS represents the desired styles that would be super.

Viewing 9 replies - 1 through 9 (of 9 total)
  • Upon further investigation I have found that the inc/class-astra-dynamic-css.php file includes a combination of variables from the Customizer and hard-coded values. Particularly I was seeking to alter the astra_parse_css breakpoint from 768/769, but those values are hard-coded throughout the file. Might that become a variable in the customizer also?

    Hi @matt6303 ,

    Would you mind letting me know what exactly you wish to have when you have Astra theme installed on your site?

    Are you bit worried about the CSS that is been loaded in your site header? If yes then you can use Autoptimize plugin in order to have static CSS file.

    Further, if you need any help regarding the breakpoints alteration then please open a ticket in our support center.

    Is it possible to disable Dynamic css by a function in my child theme?

    Hi @keepact,

    Kindly refer an article here. Hope this will help!

    Regards,
    Anjali

    Thank you!!!

    Best support ever

    Hello, just returning to say that with the provided link filter works but when I copy the inline css to an external file and link in the <head> tag not all styles come back.

    I was able to make it work with this code:

    function wpse_remove_inline_style( $dynamic_css )
    {
    wp_style_is( $dynamic_css, ‘enqueued’ )
    && wp_style_add_data( ‘astra-theme-css’, ‘after’, ” );
    }
    add_action( ‘wp_print_styles’, function()
    {
    // Remove previous inline style
    wpse_remove_inline_style( ‘astra-theme-css’ );

    } );

    Regards

    Hi @keepact ,

    Glad you figured it out. 🙂

    Alternative solution for your request without coding is that you can use autoptimize plugin.

    Here is the screenshot for that option.

    I hope this is an easy way to get what you wanted.

    Regards,
    Deepak

    Thanks for the tip.

    Hi @keepact ,

    You are welcome! 🙂

    Regards,
    Deepak

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