Skip to content
Draft
Show file tree
Hide file tree
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
5 changes: 5 additions & 0 deletions .changeset/perf-buttongroup-has-selector.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@primer/react': patch
---

perf(ButtonGroup): Scope :has() selector to direct child for O(1) lookup
3 changes: 2 additions & 1 deletion packages/react/src/ButtonGroup/ButtonGroup.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@
}

/* this is a workaround until portal based tooltips are fully removed from dotcom */
&:has(div:last-child:empty) {
/* PERFORMANCE: Scope to direct child for O(1) lookup */
&:has(> div:last-child:empty) {
button,
a {
border-radius: var(--borderRadius-medium);
Expand Down
Loading