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 the size of icons in Buttons #2330

Merged
merged 1 commit into from
Dec 8, 2023
Merged

Fix the size of icons in Buttons #2330

merged 1 commit into from
Dec 8, 2023

Conversation

connor-baer
Copy link
Member

Purpose

Before #2307, developers would pass icons as a child React Element to the IconButton component, which meant they could manually specify the icon size. Now, the icon component is passed directly as a prop, and the icon size is configured internally based on the Button's size: A small Button uses a 16px icon, and a medium Button uses a 24px icon.

Often, an icon is only available in one size that might not match the size the Button expects. The icon is up or downscaled as a workaround, and a warning is logged. Or at least it should be scaled — this is currently broken.

Approach and changes

  • Explicitly set the width and height of the icons inside Buttons according to the Button size

Definition of done

  • Development completed
  • Reviewers assigned
  • Unit and integration tests
  • Meets minimum browser support
  • Meets accessibility requirements

@connor-baer connor-baer requested a review from a team as a code owner December 8, 2023 13:59
Copy link

changeset-bot bot commented Dec 8, 2023

🦋 Changeset detected

Latest commit: 5e17ccb

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

This PR includes changesets to release 1 package
Name Type
@sumup/circuit-ui Patch

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

Copy link

vercel bot commented Dec 8, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
oss-circuit-ui ✅ Ready (Inspect) Visit Preview Dec 8, 2023 1:59pm

Copy link

codecov bot commented Dec 8, 2023

Codecov Report

Merging #2330 (5e17ccb) into main (1345824) will not change coverage.
The diff coverage is n/a.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #2330   +/-   ##
=======================================
  Coverage   96.93%   96.93%           
=======================================
  Files         251      251           
  Lines       20162    20162           
  Branches     1246     1246           
=======================================
  Hits        19545    19545           
  Misses        605      605           
  Partials       12       12           

@connor-baer connor-baer added the 🐞 bug Something isn't working as it should label Dec 8, 2023
@connor-baer connor-baer merged commit 3eafd13 into main Dec 8, 2023
15 of 16 checks passed
@connor-baer connor-baer deleted the fix/button-icon-size branch December 8, 2023 14:01
@connor-baer connor-baer mentioned this pull request Dec 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞 bug Something isn't working as it should 🗂 circuit-ui
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant