JSFiddle - React, Tailwind, and code Playground
HTML
<div class="items">
<div class="item"><span>1. маленький текст</span></div>
<div class="item"><span>2. здесь чуть больше текста</span></div>
<div class="item"><span>3. очень много текста, который переполянет весь блок</span></div>
</div>
CSS
.items {
display: flex;
flex-direction: column;
align-items: flex-start;
width: 300px;
background: blue;
}
.item {
padding: 2px 0px 5px 0px;
box-sizing: border-box;
color: #fff;
max-width: 300px;
display: block;
margin-bottom: 10px;
overflow: hidden;
border-left: 10px solid green;
position: relative;
}
.item span {
background: green;
padding-bottom: 100%;
padding: 3px 4px 100% 0px;
white-space: pre-wrap;
}
.item span:after {
position: absolute;
content: '';
width: 3px;
height: 100%;
top: 0px;
right: 0px;
}