@bytedance/mona-client-web
Version:
web for mona
87 lines (71 loc) • 1.45 kB
text/less
.wrapper {
width: 300px;
height: 225px;
display: inline-block;
overflow: hidden;
.hidden {
width: 0;
height: 0;
position: absolute;
opacity: 0;
}
.image {
width: 100%;
height: 100%;
background-repeat: no-repeat;
background-size: 100% 100%;
background-position: center center;
&.scaleToFill {
background-size: 100% 100%;
}
&.aspectFit {
background-size: contain;
}
&.aspectFill {
background-size: cover;
}
// TODO
&.widthFix {
background-size: auto;
}
&.heightFix {
background-size: auto;
}
&.top {
background-size: auto;
background-position: center top;
}
&.bottom {
background-size: auto;
background-position: center bottom;
}
&.center {
background-size: auto;
background-position: center center;
}
&.left {
background-size: auto;
background-position: left center;
}
&.right {
background-size: auto;
background-position: right center;
}
&.topleft {
background-size: auto;
background-position: left top;
}
&.topright{
background-size: auto;
background-position: right top;
}
&.bottomleft{
background-size: auto;
background-position: left bottom;
}
&.bottomright {
background-size: auto;
background-position: right bottom;
}
}
}