-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Site editor: convert device type margin styles into non-shorthand syntax #50441
Conversation
Actually, it looks like splitting the shorthand into non-shorthand props creates an issue where the top and bottom margins get overridden (which I guess proves the point of the warning). I pushed a change that should fix the issue, although I invite folks to take a closer look. |
Size Change: +27 B (0%) Total Size: 1.38 MB
ℹ️ View Unchanged
|
Flaky tests detected in 457ab32. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/4920369744
|
? `scale( ${ scale } )` | ||
: props.style?.transform, | ||
marginTop: | ||
scale !== 1 |
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.
I think this could be the correct intention, since scale
has a default value of 1
even when it's not passed as a prop.
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.
Looks good to me.
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.
LGTM 👍
What?
As flagged by @Mamaduka , #47004 introduced a warning when switching device type in the site editor.
This PR refactors slightly the code in a way that avoids the error from being logged.
Why?
Mixing shorthand and non-shorthand properties can lead to unexpected bugs.
How?
De-duped the
margin
shorthand property into the 4 individualmargin-*
non-shorthand properties.Testing Instructions