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

[PM-16102] Add min width on interactive badges #12514

Merged
merged 2 commits into from
Dec 23, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion libs/components/src/badge/badge.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export class BadgeComponent implements FocusableElement {
"disabled:tw-cursor-not-allowed",
]
.concat(styles[this.variant])
.concat(this.hasHoverEffects ? hoverStyles[this.variant] : [])
.concat(this.hasHoverEffects ? [...hoverStyles[this.variant], "tw-min-w-10"] : [])
Copy link
Contributor

Choose a reason for hiding this comment

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

Okay, this is fine because I don't want to raise the scope of this ticket, but...

This is a prime example of Tailwind implicitly encouraging weird / non-performant workarounds to simple CSS functionality vs a simple :is(a,button) selector. yells at cloud

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, we could write that here instead. But we would also need to write it for every style in hoverStyles. Also, why do we have an array of classes to begin with. โ˜๏ธ โ˜๏ธ โ˜๏ธ ๐Ÿ‘ด

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah.... I think it's worth revisiting how we are structuring css for these components

.concat(this.truncate ? this.maxWidthClass : []);
}
@HostBinding("attr.title") get titleAttr() {
Expand Down
Loading