CustomSelectControl: Use styles from SelectControl#42460
Conversation
|
Size Change: +34 B (0%) Total Size: 1.26 MB
ℹ️ View Unchanged
|
| right: $grid-unit-10; | ||
| right: $grid-unit-05; | ||
| top: 0; | ||
|
|
||
| &:not(.is-next-36px-default-size) { | ||
| right: $grid-unit-05; | ||
| } |
There was a problem hiding this comment.
I'm going to remove this conditional for now — you might notice that the spacing after the chevronDown is slightly different from the one in trunk, when __next36pxDefaultSize=true. This responsive spacing will be added back in a cleaner way after #42378 lands.
ciampo
left a comment
There was a problem hiding this comment.
Code changes LGTM 🚀
The only differences that I could notice compare to trunk are:
- the font size used to be
11px(I believed caused by adding theisSmallprop to theButtoncomponent), while it's not13px - the chevron icon to the right is rendered slightly closer to the right border, compared to how it used to be (although that will be likely fixed in a follow-up PR, like explained in this PR's description and in https://github.com/WordPress/gutenberg/pull/42460/files#r921971827)
Kapture.2022-07-15.at.14.12.27.mp4
I'm inclined to approve this PR, and consider the increase in font size an improvement towards consistency across similar select components — WDYT ?
Right, I consider the font size to be a bug fix. It's a side effect of the |
9c1afa5 to
cfc1455
Compare
What?
Reuse the same styling components used in SelectControl for a more consistent design. This replaces the hacky
Button-based styling that was being used.Why?
This eliminates a bunch of styling inconsistencies between SelectControl and CustomSelectControl, including:
Plus, we get all the size variants for free.
How?
To limit the scope of this PR, the following will be done as follow-up tasks:
chevronDownicon to the standardsuffixprop (after InputControl: Add padding wrapper for prefix/suffix #42378 lands).width: 100%overrides in the codebase.__nextConstrainedWidthflag, add an official deprecation warning.Testing Instructions
npm run storybook:devand see the CustomSelectControl story.__nextUnconstrainedWidth=false, the width behavior should be the same as in trunk. Basically, the width is 130px by default but can grow if the selected option label is longer than that.__nextUnconstrainedWidth=true, each size variant should look the same as the ones for SelectControl.Screenshots or screencast
CleanShot.2022-07-15.at.17.52.38.mp4