takamoso / postcss-aspect-ratio-polyfill

A PostCSS plugin to support aspect-ratio property.
MIT License
29 stars 8 forks source link

it don't work with height based element #9

Open yukulele opened 1 year ago

yukulele commented 1 year ago

This polyfill only work with width based elements

example:

<div class="width-based aspect-ratio-box"></div>
<div class="height-based aspect-ratio-box"></div>
.width-based {
  display: inline-block;
  border: 1px solid blue;
  width: 80px;
}

.height-based {
  display: inline-block;
  border: 1px solid red;
  height: 80px;
}

.aspect-ratio-box::before {
  float: left;
  padding-top: 56.25%;
  content: '';
}
.aspect-ratio-box::after {
  display: block;
  content: '';
  clear: both;
}

the 2nd element have a 0px width

KeepItLess123 commented 11 months ago

the same with me