Skip to content

Commit e63fed7

Browse files
committed
perf(SegmentedControl): Scope :has(:focus-visible) to direct child for O(1) lookup
Part of #7312
1 parent 335e9e8 commit e63fed7

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@primer/react': patch
3+
---
4+
5+
perf(SegmentedControl): Scope :has(:focus-visible) to direct child for O(1) lookup

packages/react/src/SegmentedControl/SegmentedControl.module.css

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,8 @@
187187
}
188188
}
189189

190-
&:focus-within:has(:focus-visible) {
190+
/* PERFORMANCE: Button is direct child of Item, scope with > for O(1) lookup */
191+
&:focus-within:has(> :focus-visible) {
191192
background-color: transparent;
192193
}
193194

0 commit comments

Comments
 (0)