diff --git a/assets/scss/_image-modal_project.scss b/assets/scss/_image-modal_project.scss index 0c8f72ffd51..f08b918b49c 100644 --- a/assets/scss/_image-modal_project.scss +++ b/assets/scss/_image-modal_project.scss @@ -3,6 +3,30 @@ cursor: pointer; } +/* Native button used as the keyboard-accessible image trigger */ +.md__image-trigger { + display: block; + width: 100%; + margin: 0; + padding: 0; + border: 0; + background: transparent; + color: inherit; + font: inherit; + text-align: inherit; + cursor: pointer; + border-radius: 4px; + + &:disabled { + cursor: default; + } + + &:focus-visible { + outline: 2px solid #00b39f; + outline-offset: 4px; + } +} + /* The Modal (background) */ .modal { display: none; @@ -48,6 +72,11 @@ overflow: hidden; border: 0; z-index: 99; + + &:focus-visible { + outline: 2px solid #00b39f; + outline-offset: 2px; + } } .modal-close::after { @@ -56,7 +85,7 @@ top: 0.2em; left: 0.1em; text-indent: 0; - content: "\00D7" + content: "\00D7"; } .modal-close:hover, diff --git a/layouts/_default/_markup/render-image.html b/layouts/_default/_markup/render-image.html index 34af92caad0..c7f62b511a4 100644 --- a/layouts/_default/_markup/render-image.html +++ b/layouts/_default/_markup/render-image.html @@ -31,14 +31,18 @@
{{- with $img }} {{- $webp := .Process "webp q85" }} - - - {{ $alt }} - + {{- else }} - {{ $alt }} + {{- end }}
diff --git a/layouts/partials/image-modal.html b/layouts/partials/image-modal.html index 72650e62a27..0c539924fb2 100644 --- a/layouts/partials/image-modal.html +++ b/layouts/partials/image-modal.html @@ -1,61 +1,220 @@ - - - \ No newline at end of file + + + + \ No newline at end of file