diff --git a/cdn.basic.css.inc b/cdn.basic.css.inc
index 198d9c9..be7175d 100644
--- a/cdn.basic.css.inc
+++ b/cdn.basic.css.inc
@@ -152,5 +152,18 @@ function _cdn_build_css_path($matches, $base = NULL) {
     $path = preg_replace('`(^|/)(?!\.\./)([^/]+)/\.\./`', '$1', $path);
   }
 
-  return 'url(' . file_create_url($path) . ')';
+  $parts = explode('?', $path);
+  $path = $parts[0];
+  // If there is a query string, transform it into keyed query parameters.
+  $options = array();
+  if (isset($parts[1])) {
+    $query_parts = explode('#', $parts[1]);
+    parse_str($query_parts[0], $options['query']);
+    // Take over the fragment, if there is any.
+    if (isset($query_parts[1])) {
+      $options['fragment'] = $query_parts[1];
+    }
+  }
+
+  return 'url(' . url(file_create_url($path), $options) . ')';
 }
