JSFiddle - React, Tailwind, and code Playground
HTML
<div class="bar" data-value="60"></div>
CSS
.bar {
position: relative;
width: 250px;
height: 50px;
text-align: center;
line-height: 50px;
background: #003458;
background: linear-gradient(to bottom, #005478 0%,#003747 100%);
color: white;
}
.bar:before {
position: absolute;
display: block;
top: 0;
left: 0;
bottom: 0;
width: 60%;
width: attr(data-value %, 0); /* currently not supported, so
fall back to hard coded 60% */
content: '';
background: rgba(255, 255, 255, 0.1);
}
.bar:after {
content: attr(data-value) "%";
}