Is there a way to truncate the content of the first 'message-title' when it reaches the edge of the green container, instead of overflowing outside? This issue might be related to Flexbox - has anyone encountered this and found a solution?
I have included relevant codepen link at the end of this post.
Markup
<div class="container">
<div class="message">
<div class="message-content">
<div class="message-header">
Header
</div>
<div class="message-body">
<div class="message-body__left">
AV
</div>
<div class="message-body__right">
<div class="message-main">
<div class="message-type">
</div>
<div class="message-details">
<div class="message-title">
Test string Test string Test string Test string Test string Test string Test string Test string
</div>
<div class="message-subtitle">
Blah blah
</div>
</div>
</div>
</div>
</div>
</div>
</div>
// more message elements...
</div>
CSS
* {
min-width: 0;
box-sizing: border-box;
}
// CSS styles for container, message, message content, etc.
// Truncation specific style for message-title
.message-title {
padding-bottom: 0.25rem;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.message-subtitle {
display: flex;
justify-content: space-between;
}
Find the Codepen example here - https://codepen.io/anon/pen/VGgQdL