       r = r.replace(':host', prefix)
       if r.indexOf(prefix)>-1 then r else "#{prefix} #{r}"
     .join(', ')
-    "#{selectorText} {#{rule.style.cssText}}"
+    return "#{selectorText} {#{rule.style.cssText}} "
   else
     subSheet = rule.cssRules || rule.rules
-    if subSheet
-      prefixRule(prefix, rule, subRule, j) for subRule, j in subSheet
-    rule.cssText
-
-appendStyle = (prefix, sheet, uri=window.location.href)->
-  uri = getUriFromHref(sheet.href || uri)
-  if !!sheet.href and !(sheet.cssRules || sheet.rules)
-    # Loading External stylesheets (out of current domain)
-    href = sheet.href
-    sheet.ownerNode.parentNode.removeChild(sheet.ownerNode)
-    fetch(href).then (text)->
-      console.log "Loaded", href
-      style = createStyleSheet(replaceLinkTagUrls(uri, text), true)
-      appendRules sheet.cssRules, uri
-      removeStyleSheet(style)
-      true
-  else
-    rules = sheet.cssRules || sheet.rules
-    appendRules(rules, uri)
-
-replaceLinkTagUrls = (uri, text)->
-  re = new RegExp "url\\(['\"]?([^)]*?)['\"]?\\)", "g"
-  text.replace(re, "url('#{uri}$1')")
-
-appendRules = (rules, uri)->
-  _.map _.toArray(rules).reverse(), (rule)->
-    cssText = rule.cssText
-    BufferedStyles.sheet.insertRule(rule.cssText, 0)
-  true
+    return rule.cssText unless subSheet
+    content = (prefixRule(prefix, subRule) for subRule, j in subSheet)
+    query = rule.cssText.split('{');
+    return "#{query[0]} {#{content.join(' ')}} "
 
 getUriFromHref = (href)->
   uri = href.split('/')

  uri.join('/')+'/'

addLink = (prefix, node)->
  appendStyle(prefix, node.sheet, getUriFromHref(node.href))

###*
 * Processes a complete document and writes a merged, prefixed stylesheet into the Main Document's HEAD.

  document.head.appendChild(style)
  style

removeStyleSheet = (style)-> style.parentNode?.removeChild(style)

getRules = (sheet)->
  return unless sheet?
  sheet.cssRules || sheet.rules

empty = (sheet)->
