Skip to content
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

FocalPointControl: Add flag to remove bottom margin #43996

Merged
merged 3 commits into from
Sep 12, 2022

Conversation

mirka
Copy link
Member

@mirka mirka commented Sep 8, 2022

Part of #38730

What?

Adds a __nextHasNoMarginBottom prop to remove the bottom margin.

Why?

Better reusability.

How?

Passes through the prop to BaseControl, as well as some special handling on ControlWrapper, where there was some additional bottom margin being added.

Testing Instructions

npm run storybook:dev and see the story for FocalPointControl.

@mirka mirka added the [Package] Components /packages/components label Sep 8, 2022
@mirka mirka self-assigned this Sep 8, 2022
@mirka mirka requested a review from ajitbohra as a code owner September 8, 2022 19:53
Comment on lines +69 to +77
const extraHelpTextMargin = ( {
hasHelpText = false,
}: FocalPointPickerControlsProps ) => {
return hasHelpText
? css`
padding-bottom: 1em;
`
: undefined;
};
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I decided it was good to keep this extra bottom margin when there is a help text provided, because the whitespace is more balanced.

@mirka mirka requested review from ciampo and chad1008 September 8, 2022 19:55
@mirka mirka mentioned this pull request Sep 8, 2022
49 tasks
Copy link
Contributor

@ciampo ciampo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀

@mirka mirka merged commit c1c046e into trunk Sep 12, 2022
@mirka mirka deleted the ts-focal-point-picker-margin branch September 12, 2022 19:40
@github-actions github-actions bot added this to the Gutenberg 14.1 milestone Sep 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Package] Components /packages/components
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants