From 37e92d10469624642e033e3623aed874214b5b71 Mon Sep 17 00:00:00 2001 From: jean-emmanuel Date: Fri, 16 Feb 2018 16:35:07 +0100 Subject: [PATCH] props:css: another regexp fix for unscoped css --- src/browser/js/app/widgets/common/widget.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/browser/js/app/widgets/common/widget.js b/src/browser/js/app/widgets/common/widget.js index ea36ad88..d998a666 100644 --- a/src/browser/js/app/widgets/common/widget.js +++ b/src/browser/js/app/widgets/common/widget.js @@ -495,7 +495,7 @@ class Widget extends EventEmitter { scopedCss = scopeCss(this.getProp('css'), prefix), unScopedCss = '' - this.getProp('css').replace(/\{[^\}]*\}/g).replace(/^.*\:.*;/m, m => unScopedCss += m) + this.getProp('css').replace(/\{[^\}]*\}/g).replace(/^.*\:.*/gm, m => unScopedCss += m[m.lenght - 1] === ';' ? m : m + ';') if (scopedCss.indexOf('@keyframes') > -1) scopedCss = scopedCss.replace(new RegExp(prefix + '\\s+([0-9]+%|to|from)', 'g'), ' $1') if (scopedCss.indexOf('&') > -1) scopedCss = scopedCss.replace(new RegExp(prefix + '\\s&', 'g'), prefix)