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

fix(button): use appropriate tokens for radii in buttons #3197

Merged
merged 2 commits into from
Oct 3, 2024

Conversation

cdransf
Copy link
Member

@cdransf cdransf commented Oct 2, 2024

Description

Replaces all of occurrences of --spectrum-component-pill-edge-to-text-* (intended to be used as padding) in the button component with the appropriate corner-radius-* tokens.

How and where has this been tested?

Verified locally in Storybook.

Validation steps

  1. Fetch the branch and run Storybook locally (or access the Storybook URL for the branch).
  2. Navigate to the button component.
  3. Verify that there are no border-radius regressions.

Regression testing

Validate:

  1. The documentation pages for at least two other components are still loading, including:
  • The pages render correctly, are accessible, and are responsive.
  1. If components have been modified, VRTs have been run on this branch:
  • VRTs have been run and looked at.
  • Any VRT changes have been accepted (by reviewer and/or PR author), or there are no changes.

Screenshots

image

To-do list

  • I have read the contribution guidelines.
  • I have updated relevant storybook stories and templates.
  • I have tested these changes in Windows High Contrast mode.
  • If my change impacts other components, I have tested to make sure they don't break.
  • If my change impacts documentation, I have updated the documentation accordingly.
  • ✨ This pull request is ready to merge. ✨

Copy link

changeset-bot bot commented Oct 2, 2024

🦋 Changeset detected

Latest commit: 88f8930

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@spectrum-css/button Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@cdransf cdransf marked this pull request as draft October 2, 2024 20:20
Copy link
Contributor

github-actions bot commented Oct 2, 2024

🚀 Deployed on https://pr-3197--spectrum-css.netlify.app

@cdransf cdransf force-pushed the cdransf/button-rounding-fix branch from e1ba0e6 to 5cc966e Compare October 2, 2024 20:22
Copy link
Contributor

github-actions bot commented Oct 2, 2024

File metrics

Summary

Total size: 4.31 MB*
Total change (Δ): 🟢 ⬇ 0.97 KB (-0.02%)

Table reports on changes to a package's main file. Other changes can be found in the collapsed Details section below.

Package Size Δ
button 83.84 KB 🟢 ⬇ 0.33 KB

Details

button

Filename Head Compared to base
index-base.css 53.89 KB 🟢 ⬇ 0.33 KB (-0.59%)
index-theme.css 30.56 KB -
index-vars.css 83.84 KB 🟢 ⬇ 0.33 KB (-0.38%)
index.css 83.84 KB 🟢 ⬇ 0.33 KB (-0.38%)
themes/express.css 29.37 KB -
themes/spectrum.css 29.43 KB -
* Size determined by adding together the size of the main file for all packages in the library.
* Results are not gzipped or minified.
* An ASCII character in UTF-8 is 8 bits or 1 byte.

@cdransf cdransf force-pushed the cdransf/button-rounding-fix branch from 5cc966e to 8f31d7e Compare October 2, 2024 20:45
@cdransf cdransf marked this pull request as ready for review October 2, 2024 20:46
@cdransf
Copy link
Member Author

cdransf commented Oct 2, 2024

✨ We don't have 1:1 value matches between the two token types (hence the usage of calc) but the resulting value should be approximately the same and behave as expected.

@cdransf cdransf added skip_vrt Add to a PR to skip running VRT (but still pass the action) ready-for-review labels Oct 3, 2024
@cdransf cdransf closed this Oct 3, 2024
@cdransf cdransf reopened this Oct 3, 2024
@cdransf cdransf requested a review from jawinn October 3, 2024 15:51
Copy link
Collaborator

@jawinn jawinn left a comment

Choose a reason for hiding this comment

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

I think this method, using the calculated value as we're now using in S2, should work just fine. We'll just need to make sure to confirm the VRTs. And adjust the changelog a little (see suggestion).

Some thoughts that I wanted to mention, but I don't think are an issue:

  • --spectrum-button-height not defined by default without a size, but this does not seem to be an issue since medium appears to require the medium class (and seems to be that way in web components as well); this component hasn't received the medium as default reorganization that other components have gotten yet, so the button without the medium class is missing a lot and isn't fully formed anyway.
  • Since there's a calc, I know when this rebases with foundations we'll need to move this property to a different location. But I think it's okay where it is now.

"@spectrum-css/button": minor
---

Replaces all of occurrences of --spectrum-component-pill-edge-to-text-_ (intended to be used as padding) in the button component with the appropriate corner-radius-_ tokens.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
Replaces all of occurrences of --spectrum-component-pill-edge-to-text-_ (intended to be used as padding) in the button component with the appropriate corner-radius-_ tokens.
Replaces the use of `--spectrum-component-pill-edge-to-text-*` tokens within the `border-radius` of the button component, as those tokens are intended to be used as padding. The border radius is now a calculated value, using half of `--spectrum-button-height`.

@cdransf cdransf force-pushed the cdransf/button-rounding-fix branch from c9f311e to 88f8930 Compare October 3, 2024 22:17
@cdransf cdransf added run_vrt For use on PRs looking to kick off VRT and removed skip_vrt Add to a PR to skip running VRT (but still pass the action) labels Oct 3, 2024
@cdransf cdransf merged commit 1eac198 into main Oct 3, 2024
14 checks passed
@cdransf cdransf deleted the cdransf/button-rounding-fix branch October 3, 2024 22:26
This was referenced Oct 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready-for-review run_vrt For use on PRs looking to kick off VRT
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants