JSFiddle - React, Tailwind, and code Playground
by Jens Kühn
HTML
<a href="#">Mini Home Updates</a>
SCSS
body {
background-color: #1b181c;
}
a {
display: inline-block;
position: relative;
padding-bottom: 1px;
color: #f2f2f7;
font-size: 24px;
line-height: 30px;
font-weight: 300;
font-style: normal;
text-transform: none;
text-decoration: none;
background: transparent;
border: 0;
margin: 0;
vertical-align: baseline;
-webkit-transition: color 0.3s ease-in-out;
-moz-transition: color 0.3s ease-in-out;
-ms-transition: color 0.3s ease-in-out;
-o-transition: color 0.3s ease-in-out;
transition: color 0.3s ease-in-out;
&:before,
&:after {
position: absolute;
height: 1px;
bottom: 0;
content: '';
background-color: #f2f2f7;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
-webkit-transition: width 0s ease, background .4s ease;
-moz-transition: width 0s ease, background .4s ease;
-ms-transition: width 0s ease, background .4s ease;
-o-transition: width 0s ease, background .4s ease;
transition: width 0s ease, background .4s ease;
}
&:before {
display: block;
left: 0;
width: 0;
}
&:after {
display: block;
right: 0;
width: 0;
-webkit-transition: width .4s ease;
-moz-transition: width .4s ease;
-ms-transition: width .4s ease;
-o-transition: width .4s ease;
transition: width .4s ease;
}
&:hover {
&:before,
&:after {
-webkit-transition: width .4s ease;
-moz-transition: width .4s ease;
-ms-transition: width .4s ease;
-o-transition: width .4s ease;
transition: width .4s ease;
}
&:before {
width: 100%;
}
&:after {
width: 100%;
background: 0 0;
-webkit-transition: all 0s ease;
-moz-transition: all 0s ease;
-ms-transition: all 0s ease;
-o-transition: all 0s ease;
transition: all 0s ease;
}
}
}