CSS has a fairly new property called aspect-ratio which has started to be available in the browsers. Albeit behind a support flag in Firefox.
This new property opens up new layout possibilities as well as helping to maintain image aspect ratios.
Code from Video: [ Ссылка ]
Dataset property video: [ Ссылка ]
Ещё видео!