diff --git a/assets/scss/_image-modal_project.scss b/assets/scss/_image-modal_project.scss index 0c8f72ffd51c..c4bd2f871005 100644 --- a/assets/scss/_image-modal_project.scss +++ b/assets/scss/_image-modal_project.scss @@ -1,6 +1,33 @@ /* The markdown image container */ .md__image { + position: relative; + display: block; + width: fit-content; + max-width: 100%; + margin: 0 auto; + cursor: pointer; +} + +/* Native button used as the keyboard-accessible image trigger */ +.md__image-trigger { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + padding: 0; + border: 0; + background: transparent; + color: inherit; + font: inherit; + text-align: inherit; cursor: pointer; + border-radius: 4px; + + &:focus-visible { + outline: 2px solid #00b39f; + outline-offset: 4px; + } } /* The Modal (background) */ @@ -48,6 +75,11 @@ overflow: hidden; border: 0; z-index: 99; + + &:focus-visible { + outline: 2px solid #00b39f; + outline-offset: 2px; + } } .modal-close::after { @@ -56,7 +88,7 @@ top: 0.2em; left: 0.1em; text-indent: 0; - content: "\00D7" + content: "\00D7"; } .modal-close:hover, @@ -64,4 +96,4 @@ color: #999; text-decoration: none; cursor: pointer; -} \ No newline at end of file +} diff --git a/layouts/_default/_markup/render-image.html b/layouts/_default/_markup/render-image.html index 34af92caad01..7f2d23476afd 100644 --- a/layouts/_default/_markup/render-image.html +++ b/layouts/_default/_markup/render-image.html @@ -30,15 +30,22 @@
{{- with $img }} - {{- $webp := .Process "webp q85" }} - - - {{ $alt }} + + {{ $alt }} + + {{- else }} + {{ $alt }} - + {{- end }} {{- else }} - {{ $alt }} {{- end }} +
diff --git a/layouts/partials/image-modal.html b/layouts/partials/image-modal.html index 72650e62a27f..648c5ae11d20 100644 --- a/layouts/partials/image-modal.html +++ b/layouts/partials/image-modal.html @@ -1,61 +1,214 @@ -