• Looking to remove inline stylesheets created by Storefront customizer. The ones in question are ‘storefront-style-inline-css’ and ‘storefront-woocommerce-style-inline-css’

    I tried dequeueing and deregistering in my child theme functions.php. I also tried using add_filter(‘storefront_customizer_css’, ‘__return_false’); but it still shows up in my page header.

    What am I missing? I’m not using these styles and they’re just taking up valuable page load.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hey Steve,

    You are using those styles because Storefront relies on them. Removing them would mean you’d just have to add them to another stylesheet elsewhere meanwhile losing any benefits the Customizer provides.

    If you check out the ‘weight’ of the CSS added inline I think you’ll conclude this isn’t worth it. We’re talking about bytes of data here.

    Thread Starter Steve Hardaway

    (@stevehardaway)

    James,

    I should specify that I’ve added them to my styles.css file already. Are they that difficult to remove? Despite the fact that they don’t ‘weigh’ much, page speed metrics still frown on inline styles.

    At this point, I just don’t want them there. Is that something you can help with?

    Thanks

    There isn’t a really clean way of removing it. You can use the storefront_customizer_css and storefront_customizer_woocommerce_css filters to return something empty. That’ll remove the inline css but you’ll still be querying get_theme_mod().

    At this point you’d be best off removing the Customizer altogether if you’re not using it. There’s probably plugins out there to do that for you.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Remove Inline css in header’ is closed to new replies.