Skip to content

Conversation

@aduth
Copy link
Member

@aduth aduth commented Dec 9, 2025

What?

Follow-up #73308 (comment)

Updates the Stack component in @wordpress/ui to require given gap tokens to use one of the available design tokens, removing support for passing numeric multipliers of the base spacing unit, or any other valid flexbox gap value.

Why?

Since this component is a foundational component of the design system, it should aim to build on design tokens that form the basis of expressing spacing in a systems-based manner.

This also proves to be a vast simplification of the component, which previously had to do some complex internal logic to juggle different forms of gap values.

Testing Instructions

Repeat Testing Instructions from #73308

@github-actions
Copy link

github-actions bot commented Dec 9, 2025

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 props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: aduth <[email protected]>
Co-authored-by: tyxla <[email protected]>
Co-authored-by: jameskoster <[email protected]>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

</Stack>
<DemoBox variant="lg" />
<Stack gap={ 0 } direction="column">
<Stack gap="2xs" direction="column">
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 wondered if we'd need some sort of "none" token, or explicitly allow a 0 value, but then I recalled that the default would be to have no gap when undefined, which is what we want (i.e. gap={ 0 } is the same as leaving out gap altogether). This is good affirmation of choosing zero spacing as the default gap behavior.

Copy link
Contributor

Choose a reason for hiding this comment

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

Do you think we should include a story to at least demonstrate that zero gap is possible?

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'll restore this to effectively on gap as an example (updated in 7628832).

I could maybe see a case that our "Default" story should actually reflect defaults and not specify the gap, but I feel like it's more practically useful to demonstrate the component with some gap. Open to revisiting.

@aduth aduth added [Type] Task Issues or PRs that have been broken down into an individual action to take [Package] UI /packages/ui labels Dec 9, 2025
@github-actions
Copy link

github-actions bot commented Dec 9, 2025

Flaky tests detected in c0cbc18.
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/20074683269
📝 Reported issues:

Copy link
Member

@tyxla tyxla left a comment

Choose a reason for hiding this comment

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

That's a nice simplification 👍

Tests as promised ✅

#73852 (comment)

Include a Storybook example that has no gap, and ensure that the component can be used without passing gap
@aduth aduth merged commit 15f6271 into trunk Dec 10, 2025
34 of 35 checks passed
@aduth aduth deleted the remove/stack-numeric-multiplier branch December 10, 2025 18:49
@github-actions github-actions bot added this to the Gutenberg 22.3 milestone Dec 10, 2025
peterwilsoncc pushed a commit to peterwilsoncc/gutenberg-build that referenced this pull request Dec 10, 2025
* UI: Update Stack component to support only gap tokens

* Remove gap from nested Stack story example

WordPress/gutenberg#73852 (comment)

Include a Storybook example that has no gap, and ensure that the component can be used without passing gap

Co-authored-by: aduth <[email protected]>
Co-authored-by: tyxla <[email protected]>
Co-authored-by: jameskoster <[email protected]>

Source: WordPress/gutenberg@15f6271
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Package] UI /packages/ui [Type] Task Issues or PRs that have been broken down into an individual action to take

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants