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 IconButtons #2332

Merged
merged 1 commit into from
Dec 8, 2023
Merged

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 IconButton's size: A small IconButton uses a 16px icon, and a medium IconButton 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 IconButtons according to the IconButton size

Definition of done

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

@connor-baer connor-baer added the 🐞 bug Something isn't working as it should label Dec 8, 2023
@connor-baer connor-baer requested a review from a team as a code owner December 8, 2023 14:32
Copy link

changeset-bot bot commented Dec 8, 2023

🦋 Changeset detected

Latest commit: c27ed6b

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 Comments Updated (UTC)
oss-circuit-ui ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 8, 2023 2:33pm

@connor-baer connor-baer merged commit 4cd3c9c into main Dec 8, 2023
8 checks passed
@connor-baer connor-baer deleted the fix/iconbutton-icon-size branch December 8, 2023 14:36
@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