787bd61ce6
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
19 lines
337 B
SCSS
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;
|
|
}
|
|
} |