• Resolved melebius

    (@melebius)


    First of all, thanks for a great plugin that speeds up my WP website and brings me to the green field on PageSpeed Insights (at least for desktop currently)! However, I’ve got a problem when minifying CSS files. When I customize the look of the NanoSpace theme (using wp-admin/customize.php), it adds some CSS code inlined to the rendered webpage after the theme’s default styles:

    <link rel='stylesheet' id='nanospace-stylesheet-main-css'  href='...' type='text/css' media='screen' />
    <link rel='stylesheet' id='nanospace-stylesheet-shortcodes-css'  href='...' type='text/css' media='screen' />
    <link rel='stylesheet' id='nanospace-stylesheet-custom-css'  href='...' type='text/css' media='screen' />
    <style id='nanospace-inline-css' type='text/css'>
    /* START CSS variables */
    ...

    When I turn on minification and/or merging CSS files, the nanospace-inline-css gets before minified theme’s CSS files which therefore override my customization (resulting in a black footer and menu items of the webpage while they should be blue).

    I tried to change the priority of add_action( 'wp_enqueue_scripts' ... in wp-content/themes/nanospace/includes/customize/class-customize-styles.php but this did not have any effect.

    Is there a way to keep the theme customization working and use CSS minifying same time?

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • @melebius Can you please try to add the custom CSS into your child theme’s CSS file and check if it works?

    Thread Starter melebius

    (@melebius)

    I tried to paste the contents of nanospace-inline-css to my child theme’s style.css and it did not help.

    On the other hand, it worked when pasted on the theme customization page (the CSS section). This could be used as a workaround. However, I’d have to repeat this whenever I modified these settings in theme customization.

    Thread Starter melebius

    (@melebius)

    I solved my problem by disabling the minify feature in WP-Optimize (while keeping it for caching) and enabled minifying in the Asset CleanUp plugin.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘CSS Minify feature breaks theme’s inline CSS’ is closed to new replies.