this issue is connected to this post: Flex align baseline content to input with label
I am grappling with the layout of my components, specifically trying to get all inputs and buttons aligned in a row with labels above the inputs and hints below. The CSS is scoped within the host and component, making CSS grid not the most ideal solution. I have flexibility to adjust styles inside the component, but changes must be contained within it.
<div style="display: flex; flex-direction: row; align-items: baseline; gap: 8px;">
<div class="myComponent" style="width: 100px">
<input id="myInput" placeholder="No label" style="width: 100%; box-sizing: border-box;"/>
</div>
<div class="myComponent" style="width: 100px">
<label for="myInput" style="display: block">Hint</label>
<input id="myInput" placeholder="test" style="width: 100%; box-sizing: border-box;"/>
<small style="display: block">hint</small>
</div>
<div class="myComponent" style="width: 100px">
<label for="myInput" style="display: block">Long Hint</label>
<input id="myInput" placeholder="test" style="width: 100%; box-sizing: border-box;"/>
<small style="display: block">A really long hint that wraps</small>
</div>
<div class="myComponent" style="width: 100px">
<label for="myInput" style="display: block">No Hint</label>
<input id="myInput" placeholder="test" style="width: 100%; box-sizing: border-box;"/>
</div>
<button style="text-wrap: nowrap;">My Button</button>
</div>