ope(scope, ext);
      scope = calcElementScope(scope, useAttr);
      return Polymer.StyleUtil.toCssText(rules, function(rule) {
        if (!rule.isScoped) {
          transformRule(rule, scope, hostScope);
          rule.isScoped = true;
        }
        if (callback) {
          callback(rule, scope, hostScope);
        }
      });
    }

    function calcElementScope(scope, useAttr) {
      if (scope) {
        return useAttr ?
          CSS_ATTR_PREFIX + scope + CSS_ATTR_SUFFIX :
   