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

SelectControl: Add flag for larger default size #42456

Merged
merged 3 commits into from
Jul 19, 2022
Merged

Conversation

mirka
Copy link
Member

@mirka mirka commented Jul 15, 2022

Part of #39397
In preparation for #41973

What?

Adds the __next36pxDefaultSize prop to SelectControl for the larger default size.

Why?

The #39397 project is on hold, but this one is necessary for implementing size variants for CustomSelectControl (#42460). Basically, I want both SelectControl and CustomSelectControl to share the underlying styling components, and CustomSelectControl already has a __next36pxDefaultSize flag. So we need to implement the flag on SelectControl for parity.

Testing Instructions

  1. npm run storybook:dev and see the SelectControl story.
  2. __next36pxDefaultSize should only affect the default size. Other size variants should be unaffected.

@mirka mirka added the [Package] Components /packages/components label Jul 15, 2022
@mirka mirka requested a review from ajitbohra as a code owner July 15, 2022 07:48
@mirka mirka self-assigned this Jul 15, 2022
@mirka mirka requested review from ciampo and chad1008 July 15, 2022 10:10
@ciampo ciampo added [Type] Enhancement A suggestion for improvement. [Feature] UI Components Impacts or related to the UI component system labels Jul 15, 2022
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.

👌 🚀

};
}

const style = sizes[ selectSize ] || sizes.default;
Copy link
Contributor

Choose a reason for hiding this comment

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

In which situation is sizes[ selectSize ] returning undefined, so that we have to fallback to the default? (same applies to the similar code change in the sizePaddings mixin)

Copy link
Member Author

Choose a reason for hiding this comment

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

Just a courtesy fallback in case a consumer passes an invalid size string.

@mirka mirka merged commit 1de02c1 into trunk Jul 19, 2022
@mirka mirka deleted the select-control-36px branch July 19, 2022 14:03
@github-actions github-actions bot added this to the Gutenberg 13.8 milestone Jul 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] UI Components Impacts or related to the UI component system [Package] Components /packages/components [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants