Skip to content

Commit a6e38ef

Browse files
committed
images: center lightbox on both axes when shown
Signed-off-by: Luca Zeuch <[email protected]>
1 parent d4f8e35 commit a6e38ef

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

assets/scss/components/_images.scss

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,27 +28,29 @@ figcaption {
2828

2929
/* CSS-only lightbox. See https://codesalad.dev/blog/how-to-create-an-image-lightbox-in-pure-css-25 */
3030
.lightbox {
31-
/* Default to hidden */
3231
display: none;
3332

34-
/* Overlay entire screen */
3533
position: fixed;
3634
z-index: 99999;
3735
top: 0;
3836
left: 0;
3937
right: 0;
4038
bottom: 0;
4139

42-
/* A bit of padding around image */
4340
padding: 1em;
4441

45-
/* Translucent background */
46-
background: rgba(0, 0, 0, 1);
42+
background: rgba(0, 0, 0, 0.85);
43+
44+
/* center that thang, ya get me? */
45+
justify-content: center;
46+
align-items: center;
47+
text-align: center;
48+
white-space: nowrap;
4749
}
4850

4951
/* Unhide the lightbox when it's the target */
5052
.lightbox:target {
51-
display: block;
53+
display: flex;
5254
}
5355

5456
.lightbox span {

0 commit comments

Comments
 (0)