-
Notifications
You must be signed in to change notification settings - Fork 77
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
new(Card): Adding two props 'noShadow' and 'selected' for Card #396
Conversation
Size Changes
View raw build statsPrevious (master){
"apollo": {
"esm": 10832,
"lib": 14147
},
"app-shell": {
"esm": 12906,
"lib": 19874
},
"composer": {
"esm": 68247,
"lib": 101805
},
"core": {
"esm": 580573,
"lib": 726065
},
"forms": {
"esm": 37350,
"lib": 49298
},
"icons": {
"esm": 156355,
"lib": 205626
},
"layouts": {
"esm": 15298,
"lib": 20770
},
"metrics": {
"esm": 5467,
"lib": 7729
},
"test-utils": {
"esm": 4279,
"lib": 5937
}
} Current{
"apollo": {
"esm": 10832,
"lib": 14147
},
"app-shell": {
"esm": 12906,
"lib": 19874
},
"composer": {
"esm": 68247,
"lib": 101805
},
"core": {
"esm": 580852,
"lib": 726374
},
"forms": {
"esm": 37350,
"lib": 49298
},
"icons": {
"esm": 156355,
"lib": 205626
},
"layouts": {
"esm": 15298,
"lib": 20770
},
"metrics": {
"esm": 5467,
"lib": 7729
},
"test-utils": {
"esm": 4279,
"lib": 5937
}
} |
@williaster @alecklandgraf PTAL when you got a chance. : ) |
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 for the delay, I think this has a couple issues we should fix before landing.
return ( | ||
<div | ||
className={cx( | ||
!noShadow && styles.card, |
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 the way you've written this breaks the component. styles.card
sets
pattern.box
(border/boxShadow/borderRadius
)backgroundColor
overflow
and your styles.card_noShadow
only applies border
and ignores the rest. it seems like we could always apply styles.card
, and re-define card_noShadow
to only override boxShadow
?
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! :)
de80436
to
818b6ad
Compare
@williaster Do you know why the pull request CI failed? looks like it's not related to my change 🤔 |
happo has been flaky recently 😞 re-running them. |
Re-run the CI a couple of times, finally got them passed 😄 @williaster PTAL |
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.
woot! lgtm, thanks for the iteration and patience with CI
to: @williaster @alecklandgraf
Description
Add two new props for the
Card
component.noShadow
that hides the shadow of the card.selected
that shows the border when selected.Motivation and Context
Background:
Some discussions are here https://git.musta.ch/airbnb/solar/issues/978, the design team call out for adding a new variation '
noShadow
' for Card to support some features like the wrapper of checkboxes.And in the long run, looks like the Lunar team also consider to refactor
clickable button checkboxes
to just being wrapped withcard
, so also adding theselected
state here in this PR.Design: figma
Testing
Local storybook and unit tests.
Screenshots
When there is noShadow:
When selected:
Checklist