My goal:
When the site has a widescreen aspect ratio, I want the background image to scale to 100% horizontally, cropping the top and bottom. This can be achieved easily using background-size: cover;
However, if the site has a vertical aspect ratio (such as on a smartphone), the image repeats vertically instead of scaling to 100% vertically, which would crop the left and right parts. How can I achieve both scenarios using only CSS?