Skip to content
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

Merged
merged 9 commits into from
Jun 30, 2023

Conversation

TylerAPfledderer
Copy link
Contributor

@TylerAPfledderer TylerAPfledderer commented May 24, 2023

Description

Part of the Implementation of the DS v1

Adds updated theming for the Button component per the new DS

Related Issue

Closes #10186
Closes #10020
Closes #8048

@gatsby-cloud
Copy link

gatsby-cloud bot commented May 24, 2023

✅ ethereum-org-website-dev deploy preview ready

@TylerAPfledderer TylerAPfledderer force-pushed the feat/button-new-ds-variants branch from c47be22 to 7669ef0 Compare June 9, 2023 04:13
@TylerAPfledderer TylerAPfledderer marked this pull request as ready for review June 9, 2023 04:13
@TylerAPfledderer TylerAPfledderer force-pushed the feat/button-new-ds-variants branch from 7669ef0 to efbdf50 Compare June 9, 2023 04:32
* Prevent React warning that does not recognize `isSecondary` on DOM
* while still sending prop to the theme config
*/
const styles = useStyleConfig("Button", { ...props, isSecondary })
Copy link
Contributor Author

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.

Copy link
Member

@pettinarip pettinarip left a 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

src/@chakra-ui/gatsby-plugin/components/Button.ts Outdated Show resolved Hide resolved
Comment on lines 22 to 26
_focusVisible: {
outline: "4px solid",
outlineColor: "primaryHover",
outlineOffset: -1,
},
Copy link
Member

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.

Copy link
Member

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.

Copy link
Contributor Author

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. 🤔

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! agreed.

src/@chakra-ui/gatsby-plugin/components/Button.ts Outdated Show resolved Hide resolved
@github-actions github-actions bot added the content 🖋️ This involves copy additions or edits label Jun 16, 2023
Copy link
Member

@pettinarip pettinarip left a 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.

Copy link
Contributor

@nloureiro nloureiro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

all good!

@TylerAPfledderer
Copy link
Contributor Author

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.

@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.

Copy link
Member

@pettinarip pettinarip left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀 Great job @TylerAPfledderer

@pettinarip pettinarip merged commit 2434529 into ethereum:dev Jun 30, 2023
@TylerAPfledderer TylerAPfledderer deleted the feat/button-new-ds-variants branch June 30, 2023 16:37
This was referenced Jul 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
content 🖋️ This involves copy additions or edits
Projects
None yet
3 participants