JSFiddle - React, Tailwind, and code Playground
by Guddu Kumar
HTML
<dl>
<dt>
Browser market share June 2015
</dt>
<dd class="percentage percentage-11"><span class="text">IE 11: 11.33%</span></dd>
<dd class="percentage percentage-49"><span class="text">Chrome: 49.77%</span></dd>
<dd class="percentage percentage-16"><span class="text">Firefox: 16.09%</span></dd>
<dd class="percentage percentage-5"><span class="text">Safari: 5.41%</span></dd>
<dd class="percentage percentage-2"><span class="text">Opera: 1.62%</span></dd>
<dd class="percentage percentage-2"><span class="text">Android 4.4: 2%</span></dd>
</dl>
CSS
dl {
display: -webkit-box;
display: -ms-flexbox;
display: flex;
background-color: white;
-webkit-box-orient: vertical;
-webkit-box-direction: normal;
-ms-flex-direction: column;
flex-direction: column;
width: 100%;
max-width: 700px;
position: relative;
padding: 20px;
}
dt {
-ms-flex-item-align: start;
align-self: flex-start;
width: 100%;
font-weight: 700;
display: block;
text-align: center;
font-size: 1.2em;
font-weight: 700;
margin-bottom: 20px;
margin-left: 130px;
}
.text {
font-weight: 600;
display: -webkit-box;
display: -ms-flexbox;
display: flex;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
height: 40px;
width: 130px;
background-color: white;
position: absolute;
left: 0;
-webkit-box-pack: end;
-ms-flex-pack: end;
justify-content: flex-end;
}
.percentage {
font-size: .8em;
line-height: 1;
text-transform: uppercase;
width: 100%;
height: 40px;
margin-left: 130px;
background: -webkit-repeating-linear-gradient(left, #ddd, #ddd 1px, #fff 1px, #fff 5%);
background: repeating-linear-gradient(to right, #ddd, #ddd 1px, #fff 1px, #fff 5%);
}
.percentage:after {
content: "";
display: block;
background-color: #3d9970;
width: 50px;
margin-bottom: 10px;
height: 90%;
position: relative;
top: 50%;
-webkit-transform: translateY(-50%);
transform: translateY(-50%);
-webkit-transition: background-color .3s ease;
transition: background-color .3s ease;
cursor: pointer;
}
.percentage:hover:after, .percentage:focus:after {
background-color: #aaa;
}
.percentage-1:after {
width: 1%;
}
.percentage-2:after {
width: 2%;
}
.percentage-3:after {
width: 3%;
}
.percentage-4:after {
width: 4%;
}
.percentage-5:after {
width: 5%;
}
.percentage-6:after {
width: 6%;
}
.percentage-7:after {
width: 7%;
}
.percentage-8:after {
width: 8%;
}
.percentage-9:after {
width:...