Style Engine: add margin support to frontend#39790
Merged
Conversation
|
Size Change: +65 B (0%) Total Size: 1.21 MB
ℹ️ View Unchanged
|
Member
Author
|
Fixing JS tests.... 😄 |
Fixing unit tests
andrewserong
approved these changes
Mar 28, 2022
Contributor
andrewserong
left a comment
There was a problem hiding this comment.
Thanks for following-up on the JS side of things @ramonjd! Works well in the editor and site editor with content that already has padding / margin set, and with freshly created blocks, and the order of the inline styles matches what's on trunk.
LGTM!
25 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What? 🙈
This PR adds margin to the list of supported Style Engine-parsed styles.
Why? 🙉
Given that it has similar values to padding, that is string and box model side values, and that the pending backend PR deals with both padding and margin, it seems like a non-controversial addition.
How? 🙊
Following how we added padding in the initial JS version of the Style Engine.
Testing Instructions
Test in both the site and block editors:
Adjust the margin of an individual block (e.g. Group). Check that the editor and frontends appear correctly and that the right inline styles are added to the block element.
Run
npm run test-unit packages/style-engine/src/test/index.jsfor glory!Run
npm run test-unit packages/edit-site/src/components/global-styles/test/use-global-styles-output.jsfor more glory!Screenshots or screencast