On gists
                Animating link
                    
                        
                    
                        CSS
                      
                        CSS trick
                      
                    
                    
                    app.css
                        Raw
                        #
                    
                        /* https://jsbin.com/piwefoxacu/edit?html,css,output */
a {
  position: relative;
  color: #000;
  text-decoration: none;
}
a:hover {
  color: #000;
}
a::before {
  content: "";
  position: absolute;
  display: block;
  width: 100%;
  height: 2px;
  bottom: 0;
  left: 0;
  background-color: #000;
  transform: scaleX(0);
  transition: transform 0.3s ease;
}
a:hover::before {
  transform: scaleX(1);
}
/* Animate the line from the right */
a::before {
  content: "";
  position: absolute;
  display: block;
  width: 100%;
  height: 2px;
  bottom: 0;
  left: 0;
  background-color: #000;
  transform: scaleX(0);
  transform-origin: top right;
  transition: transform 0.3s ease;
}