diff --git a/resources/css/components/dialog.css b/resources/css/components/dialog.css index ff85919e..74f2d82c 100644 --- a/resources/css/components/dialog.css +++ b/resources/css/components/dialog.css @@ -56,3 +56,21 @@ opacity: 1; } } + +/* + * The scrolling body is a keyboard stop of its own when nothing inside it can take focus: Chrome + * makes a scroll container focusable so the keyboard can scroll it, and `showModal()` hands it the + * dialog's first focus. It then showed the browser's own ring. It takes M3's focus indicator + * instead — 3px in secondary (tokens/state.css) — drawn inside its edge, because the dialog's + * rounded, overflow-hidden box would clip a ring drawn 2px outside. + */ +@layer components { + [data-dialog-body] { + outline: none; + } + + [data-dialog-body]:focus-visible { + outline: 3px solid var(--md-sys-color-secondary); + outline-offset: -3px; + } +} diff --git a/resources/views/components/modal.blade.php b/resources/views/components/modal.blade.php index ec150aad..bb28feeb 100644 --- a/resources/views/components/modal.blade.php +++ b/resources/views/components/modal.blade.php @@ -139,7 +139,7 @@ @endif @if ($body) -