Skip to content
This repository was archived by the owner on Oct 2, 2019. It is now read-only.

Commit bb01a20

Browse files
committed
See changelog.md for details.
1 parent 37fcdf8 commit bb01a20

24 files changed

+3684
-743
lines changed

assets/css/imageset.css

Lines changed: 40 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,6 @@
4040
zoom: 1;
4141
}
4242

43-
.imageset--multiple-ratios .imageset__element {
44-
/* Prevent flash of a skewed image after ratio has
45-
changed, but new image was not loaded yet.
46-
Not supported in IE & EDGE <= 14 */
47-
object-fit: cover;
48-
}
49-
5043
.imageset__ratio-fill {
5144
display: block;
5245
overflow: hidden;
@@ -58,7 +51,11 @@
5851
width: 100%;
5952
}
6053

61-
.js .imageset--ratio.imageset--lazyload .imageset__element {
54+
.imageset--ratio .imageset__element {
55+
z-index: 2;
56+
}
57+
58+
.imageset-js .imageset--ratio.imageset--lazyload .imageset__element {
6259
/* The actual image is kept behind the placeholder.
6360
Rather than fading in the image, the placeholder is
6461
faded out instead. This prevents the image layer to
@@ -70,21 +67,35 @@
7067
z-index: 1;
7168
}
7269

70+
.imageset-js .imageset--alpha.imageset--lazyload .imageset__element {
71+
/* Images with transparency require a different fading
72+
technique, as the placeholder would shine through,
73+
after the final image was loaded. */
74+
opacity: 0;
75+
will-change: opacity;
76+
transition: opacity 0.5s;
77+
}
78+
79+
.imageset-js .imageset--alpha.imageset--lazyload.imageset--loaded .imageset__element {
80+
opacity: 1;
81+
will-change: auto;
82+
}
83+
7384
.imageset__placeholder {
7485
display: block;
7586
position: absolute;
76-
top: 0;
77-
left: 0;
78-
width: 100%;
79-
height: 100%;
87+
z-index: 1;
88+
top: 50%;
89+
left: 50%;
90+
width: 101%;
91+
height: 101%;
8092
max-width: none !important;
93+
transform: translate(-50%, -50%);
8194
overflow: hidden;
8295
contain: strict;
83-
object-fit: cover;
84-
object-position: 50% 50%;
8596
}
8697

87-
.js .imageset--lazyload .imageset__placeholder {
98+
.imageset-js .imageset--lazyload .imageset__placeholder {
8899
/* Placeholder will be placed on top of the actual
89100
image element. This will only be applied, when
90101
JavaScript is enabled. */
@@ -106,6 +117,19 @@
106117
background-color: #efefef;
107118
}
108119

120+
.imageset--alpha .imageset__placeholder {
121+
visibility: hidden;
122+
}
123+
124+
.imageset-js .imageset--alpha .imageset__placeholder {
125+
visibility: visible;
126+
transition: opacity 0.5s 0.05s, visibility 0s 0.8s;
127+
}
128+
129+
.imageset-js .imageset--alpha:not(.imageset--placeholder--color) .imageset__placeholder {
130+
background-color: transparent;
131+
}
132+
109133
.imageset--placeholder--mosaic .imageset__placeholder {
110134
/* autoprefixer: off */
111135
/* Mosaic placeholders should render crisp! */
@@ -123,7 +147,7 @@
123147
/* Opera 26+, Chrome */
124148
}
125149

126-
.js .imageset--loaded .imageset__placeholder {
150+
.imageset-js .imageset--loaded .imageset__placeholder {
127151
/* After image is loaded, the placeholder will fade out
128152
and then change visibility to allow mouse interation
129153
with the loaded image in browsers, where the

assets/css/imageset.min.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)