PSA: keep CSS :has() rules tight — agents' broad selectors trigger huge style recalcs

jh3yy · x · 2026-11-07

A dev PSA: avoid wildcards and broad targets with CSS :has(). Coding agents love slapping :has() on landmarks, but broad rules can trigger huge style recalculations from seemingly unrelated CSS. Keep selectors tight when letting agents generate styles.

Related event: Developers warn AI agents overuse CSS :has(), risking full-page recalculation(3 posts)→

Original post →

More from coding & agent

coding & agent channel →