@mixin resizeImageY($x) { width: 100%; clip-path: inset(0 0 $x 0); -webkit-clip-path: inset(0 0 $x 0); margin-bottom: -$x; } @mixin resizeImageX($x) { $half: $x/2; clip-path: inset(0 $half+px 0 0); -webkit-clip-path: inset(0 $half+px 0 $half+px); margin-right: -$half+15+px; margin-left: -$half+px; } .panel img { @include resizeImageY(55px); @include resizeImageX(100); }