Make image carousel close if user clicks outside it
This commit is contained in:
parent
ef15e8a306
commit
b4a4084b48
@ -393,7 +393,12 @@ main {
|
|||||||
box-shadow: 0 0 1em var(--color-twitter-blue);
|
box-shadow: 0 0 1em var(--color-twitter-blue);
|
||||||
outline: none;
|
outline: none;
|
||||||
overflow: visible;
|
overflow: visible;
|
||||||
padding: 1.4em;
|
padding: 0;
|
||||||
|
line-height: 0;
|
||||||
|
|
||||||
|
.image-carousel__padding {
|
||||||
|
padding: 1.4em;
|
||||||
|
}
|
||||||
|
|
||||||
&::backdrop {
|
&::backdrop {
|
||||||
background: hsla(204, 87%, 73%, 0.3); /* based on --color-twitter-blue-light */
|
background: hsla(204, 87%, 73%, 0.3); /* based on --color-twitter-blue-light */
|
||||||
|
@ -39,9 +39,15 @@
|
|||||||
<main>
|
<main>
|
||||||
{{template "main" .}}
|
{{template "main" .}}
|
||||||
</main>
|
</main>
|
||||||
<dialog id="image_carousel" class="image-carousel">
|
<dialog
|
||||||
<a class="button image-carousel__close-button" onclick="image_carousel.close()">X</a>
|
id="image_carousel"
|
||||||
<img class="image-carousel__active-image" src="">
|
class="image-carousel"
|
||||||
|
onmousedown="event.button == 0 && event.target==this && this.close()"
|
||||||
|
>
|
||||||
|
<div class="image-carousel__padding">
|
||||||
|
<a class="button image-carousel__close-button" onclick="image_carousel.close()">X</a>
|
||||||
|
<img class="image-carousel__active-image" src="">
|
||||||
|
</div>
|
||||||
</dialog>
|
</dialog>
|
||||||
<div class="toasts" id="toasts">
|
<div class="toasts" id="toasts">
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user