Here is my React code:
<InfoWrapper>
<InfoCircle>
<span>i</span>
</InfoCircle>
<span className="info-label">
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
elit.
</span>
</InfoWrapper>
This displays correctly as shown below:
https://i.sstatic.net/dhcFM.png
The information circle is sized at 28x28.
However, when I add more text causing the span to expand across multiple lines, the size of the info circle changes to 16.5x28:
https://i.sstatic.net/F1sW2.png
I have not set any shrinking rule on InfoWrapper
, and have specified align-items: flex-start
to prevent vertical stretching of items.
Below is a snippet containing the complete code:
span {
font-size: 0.875rem;
}
.info-wrapper {
align-items: center;
display: flex;
flex-flow: row nowrap;
margin-top: 1.25rem;
}
.info-circle {
align-items: center;
background-color: #f5f7ff;
border-radius: 0.875rem;
display: flex;
flex-flow: row nowrap;
height: 1.75rem;
justify-content: center;
width: 1.75rem;
}
.info-label {
font-size: 0.9375rem;
margin-left: 0.5rem;
}
<div class="info-wrapper">
<div class="info-circle">
<span>i</span>
</div>
<span class="info-label">
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
</span>
</div>