Custom overlay with border radius

by Lauri Eskola

HTML

<button>Button</button>

CSS

body{ margin: 20px ; }

button { 
  display: inline-block;
  position: relative;
  text-align: center;
  line-height: normal;
  cursor: pointer;
  -webkit-appearance: none;
  -moz-appearance: none;
  padding: 14px 1.5em;
  background-color: #d8d9e0;
  border-radius: 2px;
  -webkit-box-shadow: 0px 1px 1px rgba(0, 0, 0, 0.25);
  box-shadow: 0px 1px 1px rgba(0, 0, 0, 0.25);
  color: #222330;
  text-decoration: none;
  font-weight: 600;
}

button:hover {
  border: 1px solid #fff;
}
button:hover:after {
  content: '';
  display: block;
  border-radius: 4px;
  position: absolute;
  top: -5px;
  left: -5px;
  right: -5px;
  border-radius: -5px;
  height: calc(100% + 2px);
  border: 4px solid #5A8BED;
}