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

FormTokenField, ComboboxControl: Add opt-in prop for next 40px default size #50261

Merged
merged 3 commits into from
May 4, 2023

Conversation

mirka
Copy link
Member

@mirka mirka commented May 2, 2023

Part of #46741

What?

To the FormTokenField and ComboboxControl components,

  • Adds a __next40pxDefaultSize prop to opt into the next 40px default size.
  • Mark the __next36pxDefaultSize as deprecated, and alias to the 40px prop.

Why?

Of the components that have a __next36pxDefaultSize prop, these are the only two that don't yet have a 40px size variant available.

How?

See inline comments.

Testing Instructions

Run npm run storybook:dev. For the FormTokenField and ComboboxControl stories:

  1. Toggling the control for the __next36pxDefaultSize prop should log a deprecation warning to the devtools console.
  2. Setting __next36pxDefaultSize to true should change the component to the 40px size.
  3. Setting __next40pxDefaultSize to true should change the component to the 40px size. (If both props are defined, the __next40pxDefaultSize prop wins.)

Screenshots or screencast

FormTokenField at the 40px size

@mirka mirka added the [Package] Components /packages/components label May 2, 2023
@mirka mirka self-assigned this May 2, 2023
Copy link
Member Author

Choose a reason for hiding this comment

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

Extracted this into a utility function because we'll be doing this for at least 6 more components.

css`
padding-top: ${ space( hasTokens ? 1 : 0.5 ) };
padding-bottom: ${ space( hasTokens ? 1 : 0.5 ) };
`;

export const TokensAndInputWrapperFlex = styled( Flex )`
padding: 5px ${ space( 1 ) };
Copy link
Member Author

Choose a reason for hiding this comment

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

Not sure why this padding was uneven 🤷

@mirka mirka requested review from ciampo and chad1008 May 2, 2023 18:22
@mirka mirka marked this pull request as ready for review May 2, 2023 18:22
@mirka mirka requested a review from ajitbohra as a code owner May 2, 2023 18:22
@mirka mirka removed the request for review from ajitbohra May 2, 2023 18:22
@github-actions
Copy link

github-actions bot commented May 2, 2023

Flaky tests detected in 53b7af2.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/4864382743
📝 Reported issues:

Copy link
Contributor

@chad1008 chad1008 left a comment

Choose a reason for hiding this comment

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

This was a fun PR, thanks for sharing it. Very cool to see the style depractation mechanisms in action!

LGTM 🚀 🚢

@mirka mirka merged commit 33fbd4a into trunk May 4, 2023
@mirka mirka deleted the form-token-field-40px branch May 4, 2023 10:37
@github-actions github-actions bot added this to the Gutenberg 15.8 milestone May 4, 2023
@ciampo
Copy link
Contributor

ciampo commented Oct 12, 2023

For the dev note, see #46741

@ciampo ciampo added the has dev note when dev note is done (for upcoming WordPress release) label Oct 12, 2023
@github-actions
Copy link

Warning: Type of PR label error

To merge this PR, it requires exactly 1 label indicating the type of PR. Other labels are optional and not being checked here.

  • Type-related labels to choose from: [Type] Automated Testing, [Type] Breaking Change, [Type] Bug, [Type] Build Tooling, [Type] Code Quality, [Type] Copy, [Type] Developer Documentation, [Type] Enhancement, [Type] Experimental, [Type] Feature, [Type] New API, [Type] Task, [Type] Performance, [Type] Project Management, [Type] Regression, [Type] Security, [Type] WP Core Ticket, Backport from WordPress Core.
  • Labels found: [Package] Components, has dev note.

Read more about Type labels in Gutenberg.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
has dev note when dev note is done (for upcoming WordPress release) [Package] Components /packages/components
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants