diff --git a/src/ShadowCSS.js b/src/ShadowCSS.js index aca0229..f9a9fd6 100644 --- a/src/ShadowCSS.js +++ b/src/ShadowCSS.js @@ -424,7 +424,7 @@ var ShadowCSS = { * Convert ^ and ^^ combinators by replacing with space. */ convertCombinators: function(cssText) { - return cssText.replace('^^', ' ').replace('^', ' '); + return cssText.replace(/\^\^/g, ' ').replace(/\^/g, ' '); }, // change a selector like 'div' to 'name div' scopeRules: function(cssRules, name, typeExtension) { diff --git a/test/html/styling/combinators.html b/test/html/styling/combinators.html index 09345dd..9ce8442 100644 --- a/test/html/styling/combinators.html +++ b/test/html/styling/combinators.html @@ -21,6 +21,10 @@ background: red; } + x-bar ^ .noogy { + background: blue; + } + x-bar ^^ .zot { color: white; } @@ -34,6 +38,7 @@ }
Bar
+
Noogy
@@ -53,12 +58,15 @@