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

Bug - Chip - add margin for badge when used in text element #5842

Closed
mcoker opened this issue Aug 11, 2023 · 0 comments · Fixed by #5844
Closed

Bug - Chip - add margin for badge when used in text element #5842

mcoker opened this issue Aug 11, 2023 · 0 comments · Fixed by #5844
Assignees
Labels
bug Something isn't working

Comments

@mcoker
Copy link
Contributor

mcoker commented Aug 11, 2023

To fix patternfly/patternfly-react#9483

TL;DR - we need to add back --pf-c-chip__c-badge--MarginLeft: var(--pf-global--spacer--xs);, and have it target the badge when it's a child of .pf-[v]-c-chip__text.


In core the badge is adjacent to .pf-[v]-c-chip__text, and in react the badge is a child of .pf-[v]-c-chip__text. Fun fact, this markup discrepancy goes back to the original implementation of a badge in the chip from 2019 via #1302 and patternfly/patternfly-react#1245

For v5, core updated the CSS to add a column-gap to the parent of the badge + text, and removed the left margin from the badge when it's a child of a chip - https://github.com/patternfly/patternfly/pull/5360/files. This broke the badges used in the react chip component.

Talking with @tlabaj we want to 1) continue supporting core and react's markup (the change outlined above should allow that), 2) add a prop to the react chip component for a count or something similar that places the badge in the chip and matches core's markup, and 3) in our next breaking change, remove this left margin we're adding back from the CSS.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

1 participant