Skip to content

Commit

Permalink
magento/magento2-page-builder/magento#637: Form field/field group vie…
Browse files Browse the repository at this point in the history
…wport scope

- collect only desktop styles
  • Loading branch information
omiroshnichenko committed Dec 1, 2020
1 parent 6ff23a2 commit c81f8d9
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions packages/pagebuilder/lib/parseStorageHtml.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,15 +90,17 @@ const convertToInlineStyles = document => {
const cssRules = styleBlock.sheet.cssRules;

Array.from(cssRules).forEach(rule => {
const selectors = rule.selectorText
.split(',')
.map(selector => selector.trim());
selectors.forEach(selector => {
if (!styles[selector]) {
styles[selector] = [];
}
styles[selector].push(rule.style);
});
if (rule instanceof CSSStyleRule) {
const selectors = rule.selectorText
.split(',')
.map(selector => selector.trim());
selectors.forEach(selector => {
if (!styles[selector]) {
styles[selector] = [];
}
styles[selector].push(rule.style);
});
}
});
});
}
Expand Down

0 comments on commit c81f8d9

Please # to comment.