-
Notifications
You must be signed in to change notification settings - Fork 685
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Developer can style content types output differently per viewport #2694
Conversation
…output differently per viewport - convert style blocks to inline styles to prevent BIC changes
|
…output differently per viewport - fix code style
const selectors = rule.selectorText | ||
.split(',') | ||
.map(selector => selector.trim()); | ||
selectors.forEach(selector => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Readability: New line after const
and/or before forEach
loop.
if (!styles[selector]) { | ||
styles[selector] = []; | ||
} | ||
styles[selector].push(rule.style); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Readability: New line after if
block.
The code looks great, and I appreciate the solution builds in backwards compatibility with older versions of Page Builder. How do we intend to handle media queries once they're introduced for responsive aspects of Page Builder? We can't just push these back into inline styles. Performance is of huge importance for PWA Studio, could you run a performance analysis of old content which has the style tags inline and then new content which needs to be converted to help better understand the negative impact this has on performance. |
@davemacaulay Media queries and other styles could be stored in the registry and received to read in configAgregators. This is will be the next iteration of changes in the Page Builder PWA package. |
@omiroshnichenko looks good, the 2ms increase in time for the |
Added Manual Test to parent issue magento/magento2-page-builder#558. |
QA Approved. |
❗❗DO NOT MERGE BEFORE magento/magento2-page-builder#558 closed ❗❗
Description
Convert style blocks to inline styles to prevent BIC changes
Related Issue
https://jira.corp.magento.com/browse/PB-558
magento/magento2-page-builder#558
Acceptance
Verification Stakeholders
Specification
Verification Steps
Screenshots / Screen Captures (if appropriate)
Checklist