Skip to main content

Posts

Showing posts with the label Accessibility

Solving ':focus-visible' Outline Clipping in Overflow-Hidden Bento Grids

  The "Bento" grid design trend—characterized by modular, card-based layouts with heavy corner rounding—has introduced a subtle but pervasive accessibility regression. To achieve the signature Bento look, developers instinctively apply  overflow: hidden  to card containers. This ensures that background images, videos, or child elements strictly adhere to the parent's  border-radius . However, this architectural decision creates a conflict with the CSS Box Model: standard focus outlines are rendered  outside  the border edge. When  overflow  is hidden, the browser clips the focus ring, rendering it invisible or partially cut off. This results in a direct violation of  WCAG 2.4.7 (Focus Visible)  and often fails  WCAG 2.2 SC 2.4.11 (Focus Appearance)  due to insufficient contrast area. Below is the root cause analysis and the architectural pattern to resolve this without compromising the design system. The Root Cause: The Paint O...

Preventing Focus Ring Clipping in Cards with `overflow: hidden`

  It is a pervasive conflict in UI architecture: your design system requires cards with rounded corners and full-bleed images, necessitating   overflow: hidden   and   border-radius . However, your accessibility requirements dictate a high-contrast focus indicator that extends beyond the component's perimeter. When you apply  overflow: hidden  to a container, it creates a hard clipping boundary. While standard CSS  outline  is painted outside the border edge, specific layout contexts (such as grid containers with their own overflow handling or transform layers) or the desire for  inset  focus styles often result in the focus indicator being chopped off or obscured by child content (like images). This results in a direct violation of  WCAG 2.4.7 (Focus Visible)  and often fails  WCAG 2.4.13 (Focus Appearance)  regarding contrast and size requirements. Here is the architectural root cause and the robust, component-level...