JSFiddle - React, Tailwind, and code Playground

by jeremyblalock

HTML

<div class='row'>
    <span class='title'>
        <span class='pill'>Draft</span>
        <span class='title-sub'>
        The short text</span>
    </span>
</div>
<div class='row'>
    <span class='title'>
        <span class='pill'>Draft</span>
        <span class='title-sub'>
        The longer text content with a little more going on. This is quite a long one indeed.</span>
    </span>
</div>
<div class='row'>
    <span class='title'>
        <span class='title-sub'>The longer text content with a little more going on. This is even a little longer one than the other!</span>
    </span>
</div>

CSS

body {
    padding: 20px;
    font-family: "Source Sans Pro";
}
.row {
    background: #eee;
    border: #ddd;
    border-radius: 5px;
    margin-bottom: 10px;
    padding: 10px 20px;
    display: block;
}
.row:before, .row:after {
  content: ' ';
  display: table;
}
.row:after { clear: both; }
.title {
    float: left;
    max-width: 100%;
}
.title-sub {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.pill {
    float: right;
    font-size: 12px;
    text-transform: uppercase;
    font-weight: 500;
    line-height: inherit;
    padding: 5px;
    margin: -3px -10px -7px 5px;
    background: #666;
    color: #fff;
    letter-spacing: 0.7px;
    border-radius: 2px;
}