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

added grid gap prop to support adding any gaps to width/height. Fixes #822 #823

Merged
merged 1 commit into from
Sep 10, 2024

Conversation

alexiz10
Copy link
Contributor

@alexiz10 alexiz10 commented Jun 26, 2024

Proposed solution

This PR fixes #822 .

If you have a grid that contains gaps between cells, the grid items will typically span over any gaps between the spanned cells. For example, if you have a grid that has cells 100px wide, with 3px gaps, an item that spans 1 cell should be 100px wide. If it spans 2 cells, it should be 203px wide (2 cells, 1 gap). The equation for this is as follows

width = (horizontalSpan * gridCellWidth) + (gridGap * (horizontalSpan - 1))

Tradeoffs

Users can optionally provide the gridGap prop if they choose. Without it, the default values are [0, 0] and the grid will work the same as before.

Testing Done

  • Created a new storybook story testing to make sure it works as expected.
  • Ran tests locally to make sure nothing else was broken.

@alexiz10
Copy link
Contributor Author

alexiz10 commented Jul 9, 2024

@bokuweb just checking in to see if there was an update on this? Thank you!.

@bokuweb
Copy link
Owner

bokuweb commented Sep 10, 2024

@alexiz10 Sorry, I' check it!!

Copy link
Owner

@bokuweb bokuweb left a comment

Choose a reason for hiding this comment

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

LGTM

@bokuweb bokuweb merged commit 463299e into bokuweb:master Sep 10, 2024
@bokuweb
Copy link
Owner

bokuweb commented Sep 10, 2024

@alexiz10 6.9.18 published 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

The grid prop doesn't account for grid gaps
2 participants