-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Layout components #3277
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
Layout components #3277
Conversation
|
Build for latest commit 2091157 is at https://pr3277.build.csb.dev/s/new. |
| // valid combinations are | ||
| // start | start + end | start + span | span | ||
| // span + end is also possible but not implemented here | ||
| export const Column = styled.div<{ |
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.
| export const Column = styled.div<{ | |
| type ColumnEnd = number | number[]; | |
| type ColumnSpan = number | number[]; | |
| type ColumnStart = number | Array<number | string>; | |
| type ColumnProps = | |
| | { end: ColumnEnd; start: ColumnStart; } | |
| | { span: ColumnSpan; } | |
| | { span: ColumnSpan; start: ColumnStart; } | |
| | { start: ColumnStart; }; | |
| export const Column = styled.div<ColumnProps>( |
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.
what does this improve?
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 implementing the Props like you said in your comments 🙂
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.
Got it. Implementing it this way would give errors on the missing prop in each, right?
repro (see end prop): https://codesandbox.io/s/funny-pare-zswfv
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 not a blocker, so I'm merging the PR but will continue to improve the types
Co-Authored-By: Michaël De Boey <[email protected]>
Grid + Stack
Built on top of #3269