props:css: another regexp fix for unscoped css

This commit is contained in:
jean-emmanuel 2018-02-16 16:35:07 +01:00
parent b903d2db49
commit 74207e89be

View file

@ -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)