-
Notifications
You must be signed in to change notification settings - Fork 43
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
refactor: use consistent button component #889
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
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 a huge diff. Can you outline a few locations in the code where I should drill down on?
It's actually not that huge! Most of the diffs are dependency changes in the lock file. I can try to split it out if you want. |
d0faf1e
to
7737ae0
Compare
@james-a-morris I split up this PR into #892 and this one. So you can review #892 first and then this one. |
src/components/Button/Button.tsx
Outdated
height: "4rem", | ||
padding: "0rem 2.5rem", |
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.
Have we begun to switch to rem
instead of px
for height/padding values?
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 noticed that in Figma we now use rem
instead of px
and I am assuming that Tim chose this setting for a reason. Converting these to px
in your head when implementing the designs also doesn't really make sense to me, so I kept rems here as well.
I know that this leads to a bit of inconsistency but I think moving to rem
makes sense. Wdyt?
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.
Ah wait, just checked again. This is a setting on my side that led to this 😓 I think in that case it makes sense to use px for now. And move over to rem later if we decide to do so
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.
Added a few comments. I don't notice any regressions when testing via the preview link.
export const UnstyledButton = styled(BaseButton)` | ||
border: none; | ||
padding: 0; | ||
height: auto; |
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 use fit-content
?
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 are the arguments for using fit-content
instead of auto
?
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 looks good to me. I don't have much else to add & everything works well on the local storybook instance I loaded.
@dohaki should we look at maybe re-introducing chromatic?
Yea we could. I don't recall why we stopped using it 🤔 |
454ca90
to
854274e
Compare
Based #892 because I used Storybook for implementing the component.
This PR does the following:
<Button />
componentCloses ACX-1646