rwd-img()
반응형 이미지 믹스인
용도
사용법
.usage {
@include rwd-img();
}.usage {
max-width: 100%;
height: auto;
}콘테이너 높이에 반응하는 이미지 설정
로직
참고
Last updated
반응형 이미지 믹스인
.usage {
@include rwd-img();
}.usage {
max-width: 100%;
height: auto;
}Last updated
.usage {
@include rwd-img($ratio-prop: height);
}.usage {
height: 100%;
width: auto;
}@mixin rwd-img($limit-origin-size: true, $ratio-prop: width) {
$prop: if($limit-origin-size, max-#{$ratio-prop}, #{$ratio-prop});
$cross-prop: if($ratio-prop == 'width', 'height', 'width');
#{$prop}: 100%;
#{$cross-prop}: auto;
}