JSFiddle - React, Tailwind, and code Playground

by mnk

HTML

<ul>
    <li style="flex: 1 1;"><span>A</span></li>
    <li style="flex: 2 2;"><span>this is a pretty long text that will overflow the parent container</span></li>
    <li style="flex: 1 1;"><span>C</span></li>
</ul>

CSS

ul {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
}

li {
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
    color: white;
}

span {
    background-color: blue;
    padding: 0em 1em;
    border-radius: 1em;
}