-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcss-lightbox.css
184 lines (182 loc) · 3.92 KB
/
css-lightbox.css
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
/*
* Adapted from http://tympanus.net/codrops/2011/12/26/css3-lightbox/
* Extra class and tag names are for extra specificity, to help increase odds of overriding theme CSS
*/
/*-------------
On-page image
-------------*/
a.lightbox-link {
position: relative;
display: inline-block;
text-decoration: none;
/* Some themes use borders as custom underlines */
border-bottom: none;
}
.lightbox-link > .lightbox-target {
display: block;
}
.lightbox-link > .lightbox-enlarge {
position: absolute;
top: 0;
left: 0;
/* Remove default theme <p> margin and padding */
margin: 0;
padding: 0;
}
.lightbox-enlarge::before {
/* Magnifying glass icon */
content: "\f179";
font-family: "dashicons";
position: absolute;
top: 0;
left: 0;
font-size: 22px;
width: 1.5em;
height: 1.5em;
/* Vertical center */
line-height: 1.5em;
text-align: center;
color: rgb(100, 100, 100);
background-color: white;
transition: color, background-color .5s;
}
.lightbox-link:hover > .lightbox-enlarge::before {
color: white;
background-color: rgb(100, 100, 100);
}
/*------------
Image Overlay
------------*/
div.lightbox-overlay {
/* Some themes make all divs border-box, override that */
box-sizing: content-box;
position: fixed;
/*
* Need to use 0 width and height instead of display: none;
* because changes to display conflict with image opacity transition
*/
height: 0;
width: 0;
left: 0;
top: 0;
padding: 0;
z-index: 99;
/* Baseline for em units */
font-size: 18px;
background:
radial-gradient(
center,
ellipse cover,
rgba(255,255,255,0.7) 0%,
rgba(165,165,5,1) 100%
);
background:
-webkit-radial-gradient(
center,
ellipse cover,
rgba(255,255,255,0.7) 0%,
rgba(165,165,175,1) 100%
);
background:
-moz-radial-gradient(
center,
ellipse cover,
rgba(255,255,255,0.7) 0%,
rgba(165,165,175,1) 100%
);
}
div.lightbox-overlay:target {
height: auto;
width: auto;
bottom: 0;
right: 0;
padding: 3em 10% 8em;
}
.lightbox-overlay > .lightbox-image {
display: block;
max-height: 100%;
margin: 0 auto;
opacity: 0;
box-shadow: 0 .25em .5em rgba(0,0,0,0.2);
transition: opacity 0.25s linear;
-webkit-transition: opacity 0.25s linear;
}
.lightbox-overlay:target > .lightbox-image {
opacity: 1;
}
.lightbox-overlay > .lightbox-close {
position: absolute;
top: 1em;
right: 1em;
width: 2em;
height: 2em;
z-index: 1001;
font-family: sans-serif;
text-align: center;
line-height: 2em;
color: white;
font-weight: bold;
background: rgb(100, 100, 100);
background: rgba(100, 100, 100, .9);
text-decoration: none;
/* Some themes use borders as custom underlines */
border-bottom: none;
-webkit-transition: transform .25s;
transition: transform .25s;
}
.lightbox-overlay > .lightbox-close:hover,
.lightbox-overlay > .lightbox-close:focus {
-webkit-transform: scale(.9);
transform: scale(.9);
}
@media(min-width: 48em) {
.lightbox-overlay > .lightbox-close {
font-size: 1.5em;
right: 2em;
}
}
.lightbox-overlay > .lightbox-inner {
display: none;
position: fixed;
bottom: 0;
right: 0;
width: 100%;
padding: 1.5em;
background-color: rgb(100, 100, 100);
background-color: rgba(100, 100, 100, .9);
}
.lightbox-overlay:target > .lightbox-inner {
display: block;
/* To get around the margin-left: 10%; from the overlay container */
margin-left: -10%;
}
.lightbox-inner > .lightbox-title {
/* Override theme default <h3> margin and padding */
margin: 0 0 .5em 0;
padding: 0;
color: lemonchiffon;
text-align: left;
}
.lightbox-inner > .lightbox-caption {
max-width: 40em;
/* Override default theme <p> margin and padding */
margin: .5em 0 0 0;
padding: 0;
text-align: left;
color: white;
}
.lightbox-inner > .lightbox-download {
display: none;
}
.lightbox-inner > .lightbox-download > a:hover,
.lightbox-inner > .lightbox-download > a:focus {
text-decoration: underline;
}
@media(min-width: 40em) {
.lightbox-inner > .lightbox-download {
display: block;
position: absolute;
right: 1.5em;
top: 1.5em;
}
}