JSFiddle - React, Tailwind, and code Playground

by AntonTrollback

HTML

<a href="#" class="btn">✔<span class="btn-effect"></span></a>

CSS

/* 
 * Expanding border
 * Inspired by Scorekeeper - youtu.be/sXqXpwyBI1k
 */

.btn {
  position: relative;
  display: block;
  width: 100px;
  height: 100px;
  margin: 130px auto;
  border-radius: 3px;
  color: #666;

  font: bold 40px/100px sans-serif;
  text-align: center;
  text-decoration: none;
  background: #f1f1f1;
  user-select: none;
}

/* Why not a pseudo-element? http://bit.ly/xkO4dn */

.btn .btn-effect {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  box-sizing: border-box;
  display: block;
  width: 100%;
  height: 100%;
  border: 3px solid transparent;
  border-radius: 3px;
  opacity: 1;
}

.btn:active {
  background: #fff;
}

.btn:active .btn-effect  {
  display: block;
  opacity: 0;
  border-color: #fff;
  -webkit-transform: scale(1.3);
  -moz-transform: scale(1.3);
  -ms-transform: scale(1.3);
  transform: scale(1.3);
  -webkit-transition: .5s ease-out;
  -moz-transition: .5s ease-out;
  -ms-transition: .5s ease-out;
  transition: .5s ease-out;
  -webkit-transition-property: transform, opacity;
  -moz-transition-property: transform, opacity;
  -ms-transition-property: transform, opacity;
  transition-property: transform, opacity;
}

/* Demo styles */

body {
  background: #222;
}

.btn:before {
  content:'click and hold :(';
  position: absolute;
  top: -100px;
  left: -50%;
  z-index: 10;
  width: 200%;
  color: #bbb;
  font-size: 16px;
  text-align: center;
}