Repository navigation
Migrate from TextControl to NumberControl to remove margin overrides - #47160
Conversation
There was a problem hiding this comment.
Because NumberControl has an option for a side label, the label ends up being more centered than it does in trunk.
And these changes remove the need for a CSS file at all for this component.
There was a problem hiding this comment.
Oh, nice find! It's aligned in FireFox but I see this in Safari now. I'll update it and check a few browsers to double-check. 👍
There was a problem hiding this comment.
I removed CSS that was added three years ago for a Safari fix, but when testing Safari with the removed code, it looked the same as other browsers.
8a95452 to
c10cd1c
Compare
|
Size Change: -207 B (0%) Total Size: 1.32 MB
ℹ️ View Unchanged
|
|
Flaky tests detected in c10cd1c. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/3917819816
|
mirka
left a comment
There was a problem hiding this comment.
Ooh, great idea to migrate to NumberControl!
| <VStack className="block-editor-image-size-control" spacing="0"> | ||
| <p>{ __( 'Image dimensions' ) }</p> | ||
|
|
||
| <HStack align="baseline" spacing="3"> |
There was a problem hiding this comment.
So it isn't needed now that we dealt with the bottom margin problem?
There was a problem hiding this comment.
@mirka, can you clarify what you mean by 'it' in your question? I'm not sure I understand so I just wanted to confirm if I need to remove anything before merging. 🙂
There was a problem hiding this comment.
Ah sorry, I meant the align="baseline".
There was a problem hiding this comment.
No worries! It is needed, from what I can tell, so it doesn't end up looking like the screenshot above.
c10cd1c to
25e09c9
Compare
| <VStack className="block-editor-image-size-control" spacing="0"> | ||
| <p>{ __( 'Image dimensions' ) }</p> | ||
|
|
||
| <HStack align="baseline" spacing="3"> |
There was a problem hiding this comment.
So it isn't needed now that we dealt with the bottom margin problem?
25e09c9 to
2ea705e
Compare


What?
Updated
TextControlinstances using type number toNumberControlcomponent.Why?
While working on this project to remove margin overrides, I thought it made more sense to use NumberControl which also helped with removing overrides.
How?
By adding NumberControl, HStack, and VStack and removing unnecessary CSS.
Testing Instructions
ImageSizeControl
Before
After
InlineUI
Before
After
PageAttributesOrder
Before
After