-
Notifications
You must be signed in to change notification settings - Fork 12
Conversation
2cd12b9
to
bc570c1
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.
looks great!
& > div:nth-of-type(n + 2) { | ||
margin-left: ${space[5]}px; | ||
} | ||
`; | ||
|
||
const collapseBelowSpacing = css` | ||
display: block; | ||
& > * + * { | ||
& > div:nth-of-type(n + 2) { |
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 don't quite follow this change. Would you mind explaining what the difference 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.
Oh yes, I was messing around with something, but I didn't need it in the end. I'll restore the old way. Thanks for asking!
8b6089f
to
cfd3986
Compare
children, | ||
...props | ||
}: ColumnProps) => { | ||
const Column = ({ width, cssOverrides, children, ...props }: 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.
if width
no longer has a default value of 0
, is this a breaking change?
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.
If you were relying on the default before then I think you still get the same behaviour (due to these changes) but if you're explicitly passing 0 you will now get different behaviour so maybe it's a breaking change? Also, if you pass an empty array I don't think it's applying any styling. Maybe that should be the same as not passing a width?
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.
@jamie-lynch is correct, if you were explicitly passing width={0}
before, the behaviour would have been the same as if you didn't pass a width (i.e. the column's width would be the remainder of container width shared between all zero-width columns). This behaviour was not documented. Arguably the behaviour is bizarre and unexpected, even a bug.
The new behaviour is to hide a column that has a 0 width. I think this is more intuitive.
Although this is technically a breaking change, I'm inclined not to treat it as such from a semver / release perspective. Nobody is currently relying on this behaviour. Let's close this loophole before people start relying on it.
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.
Good catch with the empty array 🙏
I've updated the logic to treat an empty array the same as passing not passing a width. I hope that makes sense!
…ce into sa-responsive-column-width
6b254ff
to
079cb9a
Compare
What is the purpose of this change?
It should be possible to specify the width of a column at various breakpoints, rather than the width being static across viewport widths.
It should also be possible to completely hide a column at certain breakpoints.
Fixes #701
What does this change?
Screenshots
Responsive widths
Responsive hiding
Checklist
Accessibility
Cross browser and device testing
Responsiveness
Documentation