Site editor: convert device type margin styles into non-shorthand syntax#50441
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.
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.
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
marginshorthand property into the 4 individualmargin-*non-shorthand properties.Testing Instructions