-
Notifications
You must be signed in to change notification settings - Fork 26
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
feat(spacings): support justify-content prop for Inline/Stack components #557
Conversation
65ac89d
to
e79d1ec
Compare
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.
Code looks good to me! Looking forward to have this in 🎉
Should we add also the justifyContent
to the story of Stack and Inline? 🤔
I won't affect the story, because of how it's being setup. We could add more examples in the story but then we're just testing how flexbox works, so I opted to just keep it as is. |
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.
Can you also add a VRT for this?
What do you suggest to test in the VRT? |
Or do you mean VRT for spacing components in general? |
'flex-end', | ||
'center', | ||
// Deprecated | ||
'flexStart', |
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.
Should we warning
when they're used?
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.
Hmm that might end up with a lot of noise. We can maybe do that in the next major, then in the major after that we can remove them completely.
So a two-step deprecation process.
Sure, I'll see what I can do |
Alright, I added some VRT for the |
].map(prop => ( | ||
<Spec | ||
key={`inline-justify-${prop}`} | ||
label={`Inset - when justifyContent is ${prop}`} |
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.
This is the VRT for inset not inline though 🤔
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.
Sorry just a typo
dc84ded
to
ce7ed9a
Compare
@emmenko I was going to request supporting |
@ahmehri in general, for vertical items (spacing stack) Can you describe your use case? |
Yes, my use case is positioning two items vertically with a container that has a fixed height, and position them in a way that there is a space between them. I achieved that using the component Grid, but Flexbox layout (the Spacings.Stack component) is more suitable here because of having only one dimension. The same can be achieved using Spacings.Stack if <Spacings.Stack style={{ height: "100%" }} alignContent="space-between">
<ImageLabel />
<Controls />
</Spacings.Stack> |
I see. Given that this is a special case anyway (fixed height, etc), I would suggest maybe to use a Does that make sense? |
In a way, but the idea is to use the ui-kit component in favor of the custom styles (the ultimate goal is to get rid of all the custom styles). Given that the component Spacings.Stack works in both cases (whether the container has a fixed height), I don't see why we should not support the property Another argument is to achieve symmetry between components Spacings.Inline ( |
One thing to keep in mind is that the spacing components are not the same as flex box containers. Yes, they use flex but they aim to solve a specific use case. I don't have a problem with adding the Even if we add that, you still need to solve the problem with the fixed height to solve your use case, right? Or how did you plan to solve that issue? PS: we can also think if it makes sense to add a |
You're right, passing prop
I'm more convinced now about this and think adding a new component Flex as Grid is the best solution. |
Sounds good then, PR welcomed. PS: it can also be an onboarding task if you want 😉 First thing maybe to open an issue describing the use case. Thanks 🙏 |
Fixes #552
Additional change
I also deprecated the
alignItems
values written in camelCase, which I found weird as we should simply pass the normal css values. So the "old" values are still supported for backwards compatibility.