JSFiddle - React, Tailwind, and code Playground
by extempl
HTML
<div class="parent">
<div class="child child1"> I want to set the width of this element equals to its height (which is equals to the height of the content of it's sibling, set by `align-items : stretch`) </div>
<div class="child childs-sibling">
some text <br>
some text <br>
some text <br>
some text <br>
</div>
</div>
CSS
.parent {
display: flex;
align-items: stretch;
height:200px;
}
.parent .child {
border: 1px solid black;
flex:auto;
flex-basis: 100%;
}
.parent .child1 {
flex-basis: 200px;
min-width: 200px;
}