diff --git a/src/code_manager/model/CssGenerator.js b/src/code_manager/model/CssGenerator.js index 4776d0a6d7..d7d40f98d0 100644 --- a/src/code_manager/model/CssGenerator.js +++ b/src/code_manager/model/CssGenerator.js @@ -107,11 +107,15 @@ export default Backbone.Model.extend({ const selectorStrNoAdd = rule.selectorsToString({ skipAdd: 1 }); const selectorsAdd = rule.get('selectorsAdd'); const singleAtRule = rule.get('singleAtRule'); + let isGjsRule = false; let found; // This will not render a rule if there is no its component rule.get('selectors').each(selector => { const name = selector.getFullName(); + if (name.startsWith('.gjs')) { + isGjsRule = true; + } if ( this.compCls.indexOf(name) >= 0 || this.ids.indexOf(name) >= 0 || @@ -121,8 +125,10 @@ export default Backbone.Model.extend({ } }); - if ((selectorStrNoAdd && found) || selectorsAdd || singleAtRule) { - const block = rule.getDeclaration(); + if ((selectorStrNoAdd && found) || selectorsAdd || singleAtRule || rule.attributes.style) { + const entries = Object.entries(rule.attributes.style); + const styleStr = entries.length > 0 ? entries.map(([k, v]) => `${k}:${v}`).join(';') + ';' : ''; + const block = rule.getDeclaration().length > 0 ? rule.getDeclaration() : styleStr; block && (result += block); } else { dump.push(rule); @@ -160,4 +166,4 @@ export default Backbone.Model.extend({ return this.getQueryLength(left) - this.getQueryLength(right); }); } -}); +}); \ No newline at end of file diff --git a/src/parser/model/BrowserParserCss.js b/src/parser/model/BrowserParserCss.js index abf56291bb..a598c6de18 100644 --- a/src/parser/model/BrowserParserCss.js +++ b/src/parser/model/BrowserParserCss.js @@ -15,7 +15,7 @@ const atRules = { }; const atRuleKeys = keys(atRules); const singleAtRules = ['5', '6', '11', '15']; -const singleAtRulesNames = ['font-face', 'page', 'counter-style', 'viewport']; +const singleAtRulesNames = ['font-face', 'counter-style', 'viewport']; /** * Parse selector string to array.