Last active 38 minutes ago

tre revised this gist 38 minutes ago. Go to revision

1 file changed, 1 insertion

lightbox.css

@@ -73,6 +73,7 @@ details.lightbox[open] summary, div.gallery details.lightbox[open] summary {
73 73 top: 0;
74 74 width: 100vw;
75 75 height: 100vh;
76 + z-index: 3;
76 77 background: rgba(0,0,0,0.3);
77 78 backdrop-filter: blur(5px);
78 79 cursor: unset;

tre revised this gist 4 hours ago. Go to revision

1 file changed, 87 insertions

lightbox.css(file created)

@@ -0,0 +1,87 @@
1 + /* reset stuff */
2 +
3 + div.gallery {
4 + background: none !important;
5 + border: none !important;
6 + margin: 0;
7 + padding: 0;
8 + max-width: 100%;
9 + }
10 +
11 + details.lightbox {
12 + background: none;
13 + border: none;
14 + margin: unset;
15 + padding: unset;
16 + box-shadow: none;
17 + max-width: unset;
18 + }
19 +
20 + details.lightbox:before {
21 + display: none;
22 + height: 0;
23 + width: 0;
24 + margin: 0;
25 + border: none;
26 + box-shadow: none;
27 + }
28 +
29 + details.lightbox summary {
30 + background: none;
31 + display: list-item;
32 + }
33 +
34 + details.lightbox summary:before {
35 + content: "";
36 + }
37 +
38 + /* the actual lightbox + gallery code */
39 +
40 + details.lightbox {
41 + display: inline-block;
42 + }
43 +
44 + details.lightbox summary {
45 + cursor: pointer;
46 + list-style-type: none;
47 + }
48 +
49 + div.gallery details.lightbox summary {
50 + height: 100px;
51 + width: 100px;
52 + }
53 +
54 + div.gallery details.lightbox summary img {
55 + object-fit: cover;
56 + width: 100%;
57 + height: 100%;
58 + }
59 +
60 + details.lightbox > img {
61 + position: fixed;
62 + left: 50%;
63 + top: 50%;
64 + transform: translate(-50%, -50%);
65 + max-width: 95vw;
66 + max-height: 95vh;
67 + z-index: 5;
68 + }
69 +
70 + details.lightbox[open] summary, div.gallery details.lightbox[open] summary {
71 + position: fixed;
72 + left: 0;
73 + top: 0;
74 + width: 100vw;
75 + height: 100vh;
76 + background: rgba(0,0,0,0.3);
77 + backdrop-filter: blur(5px);
78 + cursor: unset;
79 + }
80 +
81 + details.lightbox[open] summary img {
82 + display: none;
83 + }
84 +
85 + body:has(details.lightbox[open]) {
86 + overflow: hidden;
87 + }
Newer Older