Skip to content

Commit d735d75

Browse files
authored
perf(css): bucket .pagination universal * subject by child tag (#3079)
* Initial plan * perf(pagination): bucket .pagination universal `*` subject by child tag --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
1 parent ea72251 commit d735d75

2 files changed

Lines changed: 13 additions & 2 deletions

File tree

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@primer/css": patch
3+
---
4+
5+
Replace the universal `*` subject in the `.pagination` responsive rules with tag-bucketed selectors (`> a, > span, > em`). A universal subject compound (`.pagination > *`) forces Blink to test the rule against every direct child on every style recalc; bucketing by the actual child tags lets the engine fast-reject it, reducing wasted selector-matching time without changing the rendered output.

src/pagination/pagination.scss

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,11 @@
109109
// Responsive
110110

111111
// Hide everything by default
112-
> * {
112+
// Bucket on the child tag (a/span/em) instead of a universal `*` subject so
113+
// Blink can fast-reject this rule during style recalc.
114+
> a,
115+
> span,
116+
> em {
113117
display: none;
114118
}
115119

@@ -139,7 +143,9 @@
139143
// Show everything
140144

141145
@include breakpoint(md) {
142-
> * {
146+
> a,
147+
> span,
148+
> em {
143149
display: inline-block;
144150
}
145151
}

0 commit comments

Comments
 (0)