-
Notifications
You must be signed in to change notification settings - Fork 4.6k
UI: Remove support for numeric multiplier on Box padding #74008
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
Conversation
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
packages/ui/src/box/types.ts
Outdated
| /** | ||
| * The target rendering element design token grouping to use for the box. | ||
| */ | ||
| target?: string; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
By the way, was there any reason why the target type is not a union of valid strings?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I seem to recall some earlier consideration for using custom, extended targets, but now that you mention it, I'm not sure that's something we can or want to support.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I seem to recall some earlier consideration for using custom, extended targets, but now that you mention it, I'm not sure that's something we can or want to support.
More context: #72984 (comment)
Specifically this comment:
Part of the expectation here is that in how some components would use Box, they may introduce their own family of tokens, like a
Cardcomponent usingBoxand having its own card-specific spacing tokens
Realistically, the way we're implementing tokens would mean that having tokens outside what exists today would still be something we'd want to include as a peer option of the existing surface, interactive options, and as such "a union of valid strings" can follow from that.
tl;dr: Yes, we should use a union 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated in 6cf0780. Separately I'd like to explore a way to better automate these types out of our existing token files.
Co-authored-by: Lena Morita <[email protected]>
|
Flaky tests detected in 6cf0780. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/20313708348
|
What?
Updates
@wordpress/ui'sBoxcomponent to remove support for passing a number as a padding value, requiring consumers to use one of the available token values.Extracted from #74001 (see #74001 (comment)).
Why?
See #73852 for context:
Testing Instructions
None of the current stories or tests provide coverage for this, likely because it was always considered an edge case, now completely unsupported.
You can still verify there is no impact to the rendering behavior of existing Storybook stories:
npm run storybook:startBox