Skip to content

Conversation

@MattieBelt
Copy link
Contributor

@MattieBelt MattieBelt commented Mar 20, 2022

Add gap prop to Flex Component

Description

Use theme spaces to set the flex property gap on your Flex component.

Demo

Example on : https://design-system-7r256h8ex-strapijs.vercel.app/?path=/story/design-system-technical-components-flex--base

API

<Flex gap={2}>
  <IconButton label="Edit" icon={<Pencil />} />
  <IconButton label="Create" icon={<Plus />} />
  <IconButton label="Delete" icon={<Trash />} />
  <IconButton label="Publish" icon={<Play />} />
</Flex>

Discussion

  • Should gap also allow responsive properties just like the padding props in the Box component?

@vercel
Copy link

vercel bot commented Mar 20, 2022

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployments, click below or on the icon next to each commit.

design-system-website – ./website

🔍 Inspect: https://vercel.com/strapijs/design-system-website/ELwBsBxztFYGvPeAYEw8zH7zcw6N
✅ Preview: https://design-system-website-git-fork-mattiebelt-featu-3c107c-strapijs.vercel.app

design-system – ./

🔍 Inspect: https://vercel.com/strapijs/design-system/2jTBqUrSFeWS4mRWpynEZjtEe9u9
✅ Preview: https://design-system-git-fork-mattiebelt-feature-flex-gap-strapijs.vercel.app

@gu-stav
Copy link
Contributor

gu-stav commented Mar 21, 2022

Thanks also for this PR. I really like it, but need to confirm gap is within our browser support matrix (not sure about IE11): https://caniuse.com/flexbox-gap

@ronronscelestes
Copy link
Contributor

Thank you, flex gap would be great!
I wonder though if we couldn't use strapi-design-system/src/helpers/handleResponsiveValues.js helper to allow responsive values + possibility to custom column / row gap?

image

Our Grid component already does this, it allows:

gap={4}
gap={{ desktop: 5, tablet: 2, mobile: 1 }}
gap="10px 20px"

WDYT?

@MattieBelt
Copy link
Contributor Author

Thank you, flex gap would be great! I wonder though if we couldn't use strapi-design-system/src/helpers/handleResponsiveValues.js helper to allow responsive values + possibility to custom column / row gap?

image

Our Grid component already does this, it allows:

gap={4}
gap={{ desktop: 5, tablet: 2, mobile: 1 }}
gap="10px 20px"

WDYT?

I was thinking the same 😉☝🏼

Discussion
Should gap also allow responsive properties just like the padding props in the Box component?

Copy link
Collaborator

@HichamELBSI HichamELBSI left a comment

Choose a reason for hiding this comment

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

Hi @MattieBelt, thanks for the contribution 😄

@HichamELBSI HichamELBSI added the pr: enhancement This PR adds or updates some part of the codebase or features label Mar 23, 2022
@HichamELBSI HichamELBSI self-assigned this Mar 23, 2022
@HichamELBSI HichamELBSI added this to the 1.1.0 milestone Mar 23, 2022
@ronronscelestes
Copy link
Contributor

Not sure why but I had to "Approve and run" for the tests to run.
Should be good now - just need to wait for the tests to pass!

@HichamELBSI
Copy link
Collaborator

@MattieBelt You'll need to update the storyshots.

cd packages/strapi-design-system
yarn test -u

Copy link
Collaborator

@HichamELBSI HichamELBSI left a comment

Choose a reason for hiding this comment

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

LGTM

@HichamELBSI HichamELBSI merged commit 022f630 into strapi:main Apr 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr: enhancement This PR adds or updates some part of the codebase or features

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants