-
Couldn't load subscription status.
- Fork 1.2k
Allow single value for columns. Add oneThird, oneHalf, twoThirds array options #7536
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
Conversation
size-limit report 📦
|
8122cdf to
8c7f14a
Compare
8c7f14a to
e628ec8
Compare
73a5858 to
d8f14bf
Compare
| ? `var(--p-space-${spacing?.xl})` | ||
| : undefined, | ||
| } as React.CSSProperties; | ||
| } as unknown as React.CSSProperties; |
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.
Might have to collab with @aaronccasanova the TS 🧙♂️ on this. Fine for now though and we can iterate as we add similar functionality to other responsive components
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.
We can use the getResponsiveProps() function here to replace lines 48-62
...getResponsiveProps('columns', 'spacing', 'space', spacing || '4'),
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.
That won't quite solve this problem but it should clean up the code. I was planning on cleaning this stuff up after if it was blocking you but if not then I can try fixing it later today
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.
I'm not blocked by this, so all good!
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.
I think we should also allow passing in widths non responsively the way we do numbers. Like <Columns columns={['oneThird', 'twoThirds']}>
| ? `var(--p-space-${spacing?.xl})` | ||
| : undefined, | ||
| } as React.CSSProperties; | ||
| } as unknown as React.CSSProperties; |
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.
We can use the getResponsiveProps() function here to replace lines 48-62
...getResponsiveProps('columns', 'spacing', 'space', spacing || '4'),
That won't help you build the layout component though 🤔 |
|
Generally speaking any props that have responsive support should also the same values without having to include them in the responsive object. So I could do something like
Right now it seems inconsistent that you can do the above but only |
7dada5f to
81c7ced
Compare
|
I'm not sure how I feel about this API anymore so I'm moving it back to draft. Going to keep tinkering with it but I also have higher priorities for the rest of the week |
|
Hey @kyledurand, should we revisit this work or close this PR? Some of the iterations on documentation/guidance for this component includes this functionality so I'd like to verify whether we want to support this before updated guidance ships. |
|
I think this is still important. the It would make sense and be consistent for the |
|
Replaced with #8387 |
Part of #7592
API playground