Title: CSS Minify feature breaks theme’s inline CSS
Last modified: March 23, 2021

---

# CSS Minify feature breaks theme’s inline CSS

 *  Resolved [melebius](https://wordpress.org/support/users/melebius/)
 * (@melebius)
 * [5 years, 4 months ago](https://wordpress.org/support/topic/css-minify-feature-breaks-themes-inline-css/)
 * 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](https://wordpress.org/themes/nanospace/) (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](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fcss-minify-feature-breaks-themes-inline-css%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

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

 *  [Harshad](https://wordpress.org/support/users/bornforphp/)
 * (@bornforphp)
 * [5 years, 4 months ago](https://wordpress.org/support/topic/css-minify-feature-breaks-themes-inline-css/#post-14226457)
 * [@melebius](https://wordpress.org/support/users/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](https://wordpress.org/support/users/melebius/)
 * (@melebius)
 * [5 years, 4 months ago](https://wordpress.org/support/topic/css-minify-feature-breaks-themes-inline-css/#post-14226939)
 * 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](https://wordpress.org/support/users/melebius/)
 * (@melebius)
 * [5 years, 4 months ago](https://wordpress.org/support/topic/css-minify-feature-breaks-themes-inline-css/#post-14228354)
 * 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.

 * ![](https://ps.w.org/wp-optimize/assets/icon-256x256.png?rev=1552899)
 * [WP-Optimize – Cache, Compress images, Minify & Clean database to boost page speed & performance](https://wordpress.org/plugins/wp-optimize/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-optimize/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-optimize/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-optimize/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-optimize/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-optimize/reviews/)

## Tags

 * [css](https://wordpress.org/support/topic-tag/css/)

 * 3 replies
 * 2 participants
 * Last reply from: [melebius](https://wordpress.org/support/users/melebius/)
 * Last activity: [5 years, 4 months ago](https://wordpress.org/support/topic/css-minify-feature-breaks-themes-inline-css/#post-14228354)
 * Status: resolved