Target
- The SVG icon's (
{) height of must always fill the purple area's height, two merged rows ofgridlayout. - Width must automatically resize in compliance with icon's aspect ratio.
Initial listing and fiddle
<div class="Layout">
<div class="TopLabel">Lorem ipsum dolor sit amet, consectetur adipiscing elit</div>
<div class="BottomLabel">sed do eiusmod tempor incididunt ut labore et dolore magna aliqua</div>
<div class="IconSlot">
<svg class="OpeningBracketLabel" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 10 20">
<path d="M4.38 15.12c0-.7 0-1.24-.13-1.78a2.85 2.85 0 00-3-2.64l-.81-.11V9.38c0-.05.17-.12.27-.13.4 0 .82 0 1.22-.1A2.86 2.86 0 004.31 6.2c.05-.92 0-1.84.07-2.75A3.53 3.53 0 018 0h1.63a.35.35 0 01.23.06.35.35 0 01.09.26c0 .52 0 .76-.12.88s-.38.11-.85.11c-.26 0-.52 0-.78.05a2.2 2.2 0 00-2.1 2.28v2a4 4 0 01-2.51 4 .74.74 0 00-.22.1c-.07.06-.18.14-.18.2s.11.15.19.2c.4.25.82.45 1.19.72a3.79 3.79 0 011.53 3.19v2a2.33 2.33 0 002.52 2.57h1c.34 0 .32.09.33.34 0 1 0 1-.95 1a10.63 10.63 0 01-1.79-.13 3.39 3.39 0 01-2.8-3.24c-.06-.51-.03-1.07-.03-1.47z"></path>
</svg>
</div>
</div>
.Layout {
display: grid;
grid-template-columns: auto 1fr;
gap: 4px 6px;
}
.Layout + .Layout {
margin-top: 12px;
}
.TopLabel {
font-size: 14px;
line-height: 18px;
background: #BBDEFB;
}
.BottomLabel {
font-size: 12px;
line-height: 16px;
background: #FFECB3;
grid-row: 2;
}
.IconSlot {
width: 20px;
grid-row: span 2;
order: 3;
background: #E1BEE7;
}
.OpeningBracketLabel {
width: 100%;
height: 100%;
}
Some musings about this problem
I suppose the targets could not be reached without container for SVG icon (if I am wrong please let me know). So I added the .IconSlot.
Just
.OpeningBracketLabel {
height: 100%;
}
will not be enough - the layout will brake:
I added the width: 20px; for the .IconSlot temporary: without it, the icon will get too much place:


