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

Allow color to be customized for medium-sized IconButtons #4989

Merged
merged 5 commits into from
Sep 19, 2024

Conversation

camertron
Copy link
Collaborator

Customizing the color of small and large IconButtons works as expected because the component generates a stylesheet with rules targeting the size, eg. [data-size='small'] { color: green }. However for the default, medium, no size attribute is attached to the button and the generated stylesheet does not use it in its rules. This leads to a CSS specificity problem where the default color has a higher specificity than the custom color, meaning the custom color is not applied as expected.

This PR removes the special handling of the medium size, which results in the data-size attribute being added to the button and a generated stylesheet that targets it.

Closes #4863

Changelog

New

Changed

  1. Allow color to be customized for medium-sized IconButtons

Removed

Rollout strategy

  • Patch release
  • Minor release
  • Major release; if selected, include a written rollout or migration plan
  • None; if selected, include a brief description as to why

Copy link

changeset-bot bot commented Sep 19, 2024

🦋 Changeset detected

Latest commit: 8864f9f

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

This PR includes changesets to release 1 package
Name Type
@primer/react 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
Contributor

github-actions bot commented Sep 19, 2024

size-limit report 📦

Path Size
packages/react/dist/browser.esm.js 97.37 KB (-0.12% 🔽)
packages/react/dist/browser.umd.js 97.79 KB (+0.05% 🔺)

@github-actions github-actions bot temporarily deployed to storybook-preview-4989 September 19, 2024 05:50 Inactive
@camertron camertron marked this pull request as ready for review September 19, 2024 16:37
@camertron camertron requested a review from a team as a code owner September 19, 2024 16:37
@primer primer bot requested a review from a team as a code owner September 19, 2024 16:47
@primer primer bot requested a review from maximedegreve September 19, 2024 16:47
@github-actions github-actions bot temporarily deployed to storybook-preview-4989 September 19, 2024 16:50 Inactive
@camertron camertron deleted the icon_button_color_fix branch September 19, 2024 21:25
@primer primer bot mentioned this pull request Sep 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

IconButton: color override not applied for medium size
2 participants