:has() works because it only depends on the DOM and but the styles.
Even if an infinite loop is prevented during a layout pass, an infinite loop from pass to pass can still happen.
Example:
- pass 1: column too small => WithSidebarLayout -> NoSidebarLayout
- pass 2: column big enough => NoSidebarLayout -> WithSidebarLayout
- pass 3: column too small => WithSidebarLayout -> NoSidebarLayout