diff --git a/scoped.js b/scoped.js index 0f10b59..21a5d2e 100644 --- a/scoped.js +++ b/scoped.js @@ -164,9 +164,11 @@ var scopedPolyFill = ( function ( doc, undefined ) { if ( !rule.type || 1 === rule.type ) { styleRule = rule.style.cssText; - sheet.removeRule ? sheet.removeRule( index ) : sheet.deleteRule( index ); - sheet.addRule ? sheet.addRule( selector, styleRule ) : sheet.insertRule( selector + '{' + styleRule + '}', index ); - + // IE doesn't allow inserting of '' as a styleRule + if (styleRule) { + sheet.removeRule ? sheet.removeRule( index ) : sheet.deleteRule( index ); + sheet.addRule ? sheet.addRule( selector, styleRule ) : sheet.insertRule( selector + '{' + styleRule + '}', index ); + } } } }