v148 · CSS · focus · top layer
Top-Layer Focus Demo
Watch :focus-within in real time as focus moves between main-page elements, a dialog (top layer), and a popover (top layer). Chrome 148 stops these pseudo-classes from propagating across the top-layer boundary.
live focus monitor
selector status
-
body:focus-withinPage root -
main:focus-withinMain content -
#ctx-main:focus-withinMain-page context card -
#ctx-form:focus-withinForm context card
In Chrome 148+, when focus moves into a dialog or popover (top layer), body:focus-within and main:focus-within no longer light up — the boundary blocks propagation.
focus contexts
Popover — Top Layer
Same boundary rules apply to popovers in Chrome 148.
Chrome 148 boundary mode
Toggle to see an explanation of how the boundary changes :focus-within propagation.
:focus-within does not propagate to flat-tree ancestors. The boundary isolates focus state — matching Firefox and Safari's long-standing behaviour.
focus trap tester
Tab through these fields. The trap confines Tab navigation to this group — a pattern used in dialogs. Observe how the :focus-within indicators above track the active field.
implementation reference
Need the exact API surface, compatibility boundaries, errors, lifecycle, and source links? Read the matching gendn reference ↗