Repository navigation
FontSizePicker: Add flag to remove bottom margin - #43062
Conversation
|
Size Change: +122 B (0%) Total Size: 1.27 MB
ℹ️ View Unchanged
|
be609ba to
6bc2f8e
Compare
| @@ -212,6 +213,7 @@ function UnforwardedRangeControl< IconProps = unknown >( | |||
|
|
|||
| return ( | |||
| <BaseControl | |||
There was a problem hiding this comment.
@ciampo There is an ever so slight space here that I can only resolve by setting a line-height: 0 on .components-base-control__field, and I don't know what is happening 😂 Let me know if you have any ideas.
There was a problem hiding this comment.
That's the typical "white space" issue that happens around inline elements — there are different ways to fix, including setting font-size: 0 or line-height: 0 on .components-base-control__field.
But in my opinion those are just "patchy" fixes — a better way to handle it is to avoid having inline elements, which cause the white space in the first place.
The easiest fix would be to change RangeControl's Root element from display: inline-flex to display: flex.
In case there was a reason for that Root element to be inline-flex and we don't want to touch it, another alternative is to set display: flex; flex-direction: column on .components-base-control__field (also in this scenario, we'd need to check that this change doesn't introduce any regression).
Bonus round: for both proposed solutions, we could use HStack or VStack instead!
There was a problem hiding this comment.
I had so much trouble finding the culprit, thank you 😂
The easiest fix would be to change
RangeControl'sRootelement fromdisplay: inline-flextodisplay: flex.
I went with this fix — it looks safe from what I could gather.
ciampo
left a comment
There was a problem hiding this comment.
Code changes are looking good. I'll give it a last round of review once the white space glitch is addressed !
It was 😱 I'm so glad there was a test that caught it, it would've been very bad if that was merged 😱😱 9db8f69 Conditional Components: A Cautionary Tale |
There was a problem hiding this comment.
LGTM 🚀
I only noticed still a little glimpse of a white space in the RangeControl component when adding a before/after icon
Kapture.2022-08-11.at.18.12.52.mp4
It should be fixable by setting display: flex on AfterIconWrapper and BeforeIconWrapper (but I haven't double-checked) 🤞
Feel free to merge once this small details is taken care of :)
a313a01 to
aa8d839
Compare

Closes #38720
Part of #39358
What?
Adds a
__nextHasNoMarginBottomprop to the following components, to opt into the new margin-free styles.Why?
For easier reuse and consistency in spacing.
How?
This PR just adds the flags. The in-repo migration and official deprecation tasks will continue to be tracked at #39358.
Testing Instructions
Apply this patch for easier testing in Storybook (it injects a colored div after the component):
npm run storybook:devCheck the stories for ToggleGroupControl, RangeControl, and FontSizePicker.