Files
scss-grid/mixins/layout/image/_cover.scss
T
simongehrig d720639d65 SCSS Framework
Layout > Image > Cover > Aspect ratio was 9/16 instead of 16/9 for 16:9  --> corrected

!! CAREFUL WITH EXISTING PAGES !!
2017-04-26 17:11:41 +02:00

19 lines
315 B
SCSS

@mixin image-cover($heightaspect) {
/* image cover */
position: relative;
display: inline-block;
overflow: hidden;
img {
position: absolute;
object-fit: cover;
width: 100%;
height: 100%;
}
&:after {
content: "";
display: block;
padding-bottom: 100% / $heightaspect;
}
}