JSFiddle - React, Tailwind, and code Playground
by Łukasz Bącik
HTML
<ul>
<li><a href="#">Home</a></li>
<li><a href="#">Some page</a></li>
<li><a href="#">Some other page</a></li>
<li><a href="#">Last page</a></li>
</ul>
CSS
ul li {
display: inline-block;
}
ul li a {
display: block;
height: 26px;
line-height: 26px;
color: #000;
text-decoration: none;
padding: 0 5px;
margin: 0 5px;
text-transform: uppercase;
position: relative;
}
ul li a:after,
ul li a:before {
content: '';
display: block;
height: 1px;
width: 0%;
background: #000;
position: absolute;
transition: width 0.2s ease-in-out;
}
ul li a:after {
bottom: 0;
right: 0;
}
ul li a:before {
top: 0;
left: 0;
}
ul li a:hover:before,
ul li a:hover:after {
width: 100%;
}