tomayac’s avatartomayac’s Twitter Archive—№ 11,892

    1. Can't wait for the aspect-ratio property to land in browsers: smashingmagazine.com/2019/03/aspect-ratio-unit-css/ by @rachelandrew. css video { width: 100%; height: auto; aspect-ratio: 16/9; /* 👌 */ }
  1. …in reply to @tomayac
    @rachelandrew Example 2 in the spec drafts.csswg.org/css-sizing-4/#propdef-aspect-ratio solves the YouTube iframe embed video dimension issue really elegantly: css @​supports (aspect-ratio: attr(width px) / 1) { iframe { aspect-ratio: attr(width px) / attr(height px); width: 100%; height: auto; } }