PSA: AI agents love slapping broad :has() rules on CSS, causing huge style recalcs
jh3yy · x · 2026-11-07
jh3yy warns to keep CSS :has() rules tight — no wildcards or broad targets. Agents love putting :has() on landmark elements, which can trigger massive style recalcs from seemingly unrelated rules.
The accompanying demo shows Chrome's invalidation walk: one .active class change re-checks every :has() anchor up the tree, and a shared list containing restyles everything inside main — 29 of 30 elements restyled for one change, while Firefox/Safari only restyle the .tab subtree.
More from coding & agent
- BoopFace: MIT-licensed SVG robot avatar Web Component with an ESP32/STM32 embedded engine — Additional-Ad5527 · 2026-11-07
- When code is nearly free: the real bottlenecks in scaling AI-built software — rseroter · 2026-11-07
- OpenClaw rebuilt model discovery so new models ship without waiting for a release — heyneighbor · 2026-11-07
- RecallDesk: an open-source support agent with persistent memory that separates attempts from confirmed fixes — geethacharan · 2026-11-07
- Jiayuan shares his agent merge workflow prompt with confidence-scored triage — jiayuan_jy · 2026-11-07
- OpenAI Agents API October drop: auto review, scheduled automations, mid-session tool swaps — OpenAIDevs · 2026-11-07