Title: Doesn&#8217;t work with @import
Last modified: April 12, 2022

---

# Doesn’t work with @import

 *  Resolved [swinggraphics](https://wordpress.org/support/users/swinggraphics/)
 * (@swinggraphics)
 * [4 years, 2 months ago](https://wordpress.org/support/topic/doesnt-work-with-import/)
 *     ```
       @import "other-file.css";
   
       .selector {…}
       ```
   
 * gets combined as:
 *     ```
       …
       ;.selector{…}
       ```
   
 * which is invalid. Needless to say, this breaks the selector and therefore the
   site.
    -  This topic was modified 4 years, 2 months ago by [swinggraphics](https://wordpress.org/support/users/swinggraphics/).
    -  This topic was modified 4 years, 2 months ago by [swinggraphics](https://wordpress.org/support/users/swinggraphics/).

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

 *  Plugin Support [Plamen M](https://wordpress.org/support/users/plamenm/)
 * (@plamenm)
 * [4 years, 2 months ago](https://wordpress.org/support/topic/doesnt-work-with-import/#post-15552705)
 * Hello [@swinggraphics](https://wordpress.org/support/users/swinggraphics/) ,
 * We will gladly try to assist with the reported issue as much as we can. Could
   you please provide us with step-by-step instructions in the format: “click here,
   type this click there” so that we can try to recreate the issue at our end?
 * If your site is hosted with SiteGround, you may also want to mention its domain
   or post a support ticket, so that we can investigate the issue on the server 
   side.
 * We look forward to your reply.
 * Regards,
    Plamen.M Tech Support Supervisor SiteGround.com
 *  Thread Starter [swinggraphics](https://wordpress.org/support/users/swinggraphics/)
 * (@swinggraphics)
 * [4 years, 2 months ago](https://wordpress.org/support/topic/doesnt-work-with-import/#post-15552797)
 * This is a problem with the plugin, not with my account.
 * Steps to reproduce:
    1. Use a stylesheet that includes `@import`. 2. Enable SG
   Optimizer with Minify CSS Files and Combine CSS Files enabled. 3. See that the
   first style rule that follows `@import` is broken.
 *  Plugin Support [Plamen M](https://wordpress.org/support/users/plamenm/)
 * (@plamenm)
 * [4 years, 2 months ago](https://wordpress.org/support/topic/doesnt-work-with-import/#post-15552809)
 * Thank you for the update. We are not in depth familiar with all possible Themes
   and plugins out there and we can not know which ones have [@import](https://wordpress.org/support/users/import/)
   in their stylesheet files. This is why, please be more specific by providing 
   us with the name (and version) of a **free** theme or a **free** plugin which
   you found to use the [@import](https://wordpress.org/support/users/import/) so
   that we can try to recreate the reported issue on a clean WordPress instance 
   with this theme.
 * We look forward to your reply.
 * Regards,
    Plamen.M Tech Support Supervisor SiteGround.com
 *  Thread Starter [swinggraphics](https://wordpress.org/support/users/swinggraphics/)
 * (@swinggraphics)
 * [4 years, 2 months ago](https://wordpress.org/support/topic/doesnt-work-with-import/#post-15552875)
 * Your plugin should work with any valid CSS file and not introduce errors that
   render any part invalid. I am not going to search the directory for an example.
   You can jolly well create the minimal example from the code I already provided.
   A child theme you create is free, after all.
 *  Plugin Support [Plamen M](https://wordpress.org/support/users/plamenm/)
 * (@plamenm)
 * [4 years, 2 months ago](https://wordpress.org/support/topic/doesnt-work-with-import/#post-15552910)
 * The SiteGround Optimizer plugin works perfectly fine with CSS code that follows
   the standards for Stylesheets coding. However, no CSS Stylesheet minification
   plugin works 100% with all the CSS code out there. There could be a variety of
   plugin/theme combinations which might be applying partial minification or use
   code which does not follow the full stylesheet standards, in these cases, you
   can choose to use the other functions of our plugin and pick a different plugin
   for the minification part.
 * Despite of this, I will report your findings to our plugin developers and have
   them test the issue and decide if a fix should be applied in future versions.
 * Regards,
    Plamen.M Tech Support Supervisor SiteGround.com
 *  Thread Starter [swinggraphics](https://wordpress.org/support/users/swinggraphics/)
 * (@swinggraphics)
 * [4 years, 2 months ago](https://wordpress.org/support/topic/doesnt-work-with-import/#post-15552927)
 * > The SiteGround Optimizer plugin works perfectly fine with CSS code that follows
   > the standards for Stylesheets coding
 * No, it doesn’t. That’s why I’m reporting this bug.
 *     ```
       @import "file.css";
   
       .colorize { color: red; }
       ```
   
 * is perfectly valid CSS. Your plugin screws it up.
 *  Plugin Support [Plamen M](https://wordpress.org/support/users/plamenm/)
 * (@plamenm)
 * [4 years, 2 months ago](https://wordpress.org/support/topic/doesnt-work-with-import/#post-15552955)
 * I already reported this to the plugin developers. You should disable the combination
   option, since it does not work with your code. Try using the other functions 
   of the SiteGround Optimizer plugin and pick a different plugin to use for your
   CSS combining and minification needs.
 * Thank you.
 * Regards,
    Plamen.M Tech Support Supervisor SiteGround.com
 *  Thread Starter [swinggraphics](https://wordpress.org/support/users/swinggraphics/)
 * (@swinggraphics)
 * [4 years, 2 months ago](https://wordpress.org/support/topic/doesnt-work-with-import/#post-15552957)
 * Yep, I switched to W3TC

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

The topic ‘Doesn’t work with @import’ is closed to new replies.

 * ![](https://ps.w.org/sg-cachepress/assets/icon-256x256.gif?rev=2971889)
 * [Speed Optimizer - The All-In-One Performance-Boosting Plugin](https://wordpress.org/plugins/sg-cachepress/)
 * [Support Threads](https://wordpress.org/support/plugin/sg-cachepress/)
 * [Active Topics](https://wordpress.org/support/plugin/sg-cachepress/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/sg-cachepress/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/sg-cachepress/reviews/)

 * 8 replies
 * 2 participants
 * Last reply from: [swinggraphics](https://wordpress.org/support/users/swinggraphics/)
 * Last activity: [4 years, 2 months ago](https://wordpress.org/support/topic/doesnt-work-with-import/#post-15552957)
 * Status: resolved