62 lines
1.2 KiB
CSS
62 lines
1.2 KiB
CSS
@layer components {
|
|
.lightbox {
|
|
--dialog-duration: 350ms;
|
|
|
|
background-color: transparent;
|
|
block-size: 100dvh;
|
|
border: 0;
|
|
display: grid;
|
|
inline-size: 100dvw;
|
|
inset: 0;
|
|
margin: auto;
|
|
max-height: unset;
|
|
max-width: unset;
|
|
overflow: hidden;
|
|
padding: var(--block-space-half) var(--inline-space);
|
|
place-items: center;
|
|
|
|
&::backdrop {
|
|
-webkit-backdrop-filter: blur(16px);
|
|
backdrop-filter: blur(16px);
|
|
background-color: oklch(var(--lch-canvas) / 50%);
|
|
}
|
|
|
|
/* Default transition state */
|
|
&, &::backdrop, img {
|
|
opacity: 0;
|
|
transition: var(--dialog-duration) allow-discrete;
|
|
transition-property: display, opacity, overlay, transform;
|
|
}
|
|
|
|
img {
|
|
transform: translateY(10dvh);
|
|
}
|
|
|
|
&[open] {
|
|
&, &::backdrop, img {
|
|
opacity: 1;
|
|
transform: translateY(0);
|
|
}
|
|
}
|
|
|
|
@starting-style {
|
|
&[open],
|
|
&[open]::backdrop {
|
|
opacity: 0;
|
|
}
|
|
}
|
|
}
|
|
|
|
.lightbox__btn {
|
|
align-self: start;
|
|
grid-area: 1/1;
|
|
justify-self: end;
|
|
}
|
|
|
|
.lightbox__image {
|
|
grid-area: 1/1;
|
|
max-inline-size: calc(100dvw - (var(--inline-space) * 2));
|
|
max-block-size: calc(100dvh - (var(--block-space) * 2));
|
|
}
|
|
}
|