Files
simongehrig 787bd61ce6 SCSS Framework
Added modernizr script to image Cover example
Added Aspect Ratio variables
Fixed image->fit aspect ratio to w/h instead of h/w
Added impotrant to width/height in image ->cover

TODO vertical center mixin
2017-05-03 10:00:51 +02:00

19 lines
337 B
SCSS

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