Accessibility

  • On the web, use <dialog> opened with showModal(), or role="alertdialog" with aria-modal="true", aria-labelledby (the title) and aria-describedby (the body).
  • Focus moves into the dialog when it opens, to Cancel. Tab and Shift+Tab stay inside it, Escape closes it, and focus returns to the control that opened it. A destructive dialog never opens with focus on the destructive button.
  • Buttons are 48 px high on phones (size-control-lg) and at least 40 px on the web.
  • Contrast: ink on surface is 17.4:1 in light and 14.4:1 in dark; the body in ink-muted 6.7:1 and 8.1:1; Cancel in accent 7.6:1 and 8.2:1; on-ink on ink 16.7:1 and 15.9:1; on-critical on critical 6.5:1 and 7.7:1.