-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
feat(theme/Button): implement new DS theming #10315
feat(theme/Button): implement new DS theming #10315
Conversation
✅ ethereum-org-website-dev deploy preview ready
|
c47be22
to
7669ef0
Compare
7669ef0
to
efbdf50
Compare
* Prevent React warning that does not recognize `isSecondary` on DOM | ||
* while still sending prop to the theme config | ||
*/ | ||
const styles = useStyleConfig("Button", { ...props, isSecondary }) |
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 approach allows us to retain the Chakra Button component with all its defaults for ARIA and baseline styles that are not in the theme config.
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.
Awesome! loved the multiline buttons, great job!
As a general feedback:
- we merged the nested semantic tokens PR so we will need to update those values in this PR
- I see a difference in height between the outline and the other variants. We are not counting the borders. To fix this problem, I'd set a transparent 1px border on the other variants to get the same height.
- [minor] the button's height in the DS is
42px
. Would be nice if we could get that exact size. I'm not sure where is the problem because I see that we are using the correct font size and line height (1.6) cc @nloureiro
_focusVisible: { | ||
outline: "4px solid", | ||
outlineColor: "primaryHover", | ||
outlineOffset: -1, | ||
}, |
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.
Out of the scope of this PR, but wondering if we could put this somewhere to reuse it in the rest of the 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.
Same with the transition
rules. We want the same animation timings for everything.
Only if it make sense, if not, ignore 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.
@pettinarip I think adding objects in components.utils
file will be the simplest here. 🤔
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.
Nice! agreed.
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.
Just want to callout that the sold and outline variants have different height. There are 2pxs difference because the solid one doesn't count the border that the outline has.
Maybe we need to define that border in the solid variant as transparent to keep both heights equal.
The rest is looking good for me.
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.
all good!
@pettinarip This is reflected in the DS, as a border is indeed declared in all the styles that I could see. I made the update. I also added a tweak in line-height that was not the same as in the DS to ensure further consistency. |
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.
🚀 Great job @TylerAPfledderer
Description
Part of the Implementation of the DS v1
Adds updated theming for the
Button
component per the new DSRelated Issue
Closes #10186
Closes #10020
Closes #8048