Query Beginnings
Encountering unexpected behavior while using the value unset with the rule object-fit led me to question if there might be a rationale or workaround for this peculiar issue.
Demonstration
.block {
&__img {
width: 100%;
height: 50%;
}
&--portrait {
.block__img {
width: unset;
height: unset;
object-fit: cover;
}
}
}
In the above code snippet, despite setting the image's height and width as unset along with the object-fit
style rule (which should result in the image taking on the dimensions specified by cover
), it seems that the image retains its original size. The query is why does unset
impact a rule with a different property name?
Could there be some hidden interaction between object-fit
, height
, and width
when the CSS is being processed?