Last active 2 hours ago

Revision 7851b32be0974abb39a30cd5f2e6a9cd054b1db7

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