JSFiddle - React, Tailwind, and code Playground
by jimousse
HTML
<div class="parent">
<div class="child1">
child 1
</div>
<div class="child2">
<button class="mybutton">
<span class="magic">
<div class="score">
need to grow
</div>
</span>
</button>
</div>
</div>
CSS
.parent {
height: 150px;
width: 200px;
display: flex;
flex-direction: column;
background: salmon;
border: 2px solid black;
}
.child1 {
background: red;
flex-basis: 0;
}
.child2 {
background: grey;
flex-grow: 1;
flex-basis: 0;
display: -webkit-flex;
display: flex;
-webkit-flex-direction: column;
flex-direction: column;
-webkit-justify-content: center;
width: inherit;
}
.mybutton {
background: purple;
flex-grow: 1;
flex-basis: 0;
height: 100%;
width: inherit;
}
.magic {
height: 100%;
display: -webkit-flex;
display: flex;
-webkit-flex-direction: column;
flex-direction: column;
-webkit-justify-content: center;
justify-content: center;
background: lightblue;
}
.score {
height: 100%;
}