JSFiddle - React, Tailwind, and code Playground

by klierik

HTML

<button class="btn"><span>Shop Now</span></button>

SCSS

body {
  padding: 2% 3%;
}

.btn {
  line-height: 44px;
  padding: 0 20px;
  position: relative;
  background: none;
  border: 0;
  text-transform: uppercase;
  cursor: pointer;

  &::before,
  &::after {
    display: block;
    width: 100%;
    height: 100%;
    position: absolute;
    content: '';
    border-color: #000;
    border-style: solid;
    transition: all 200ms ease;
  }

  &::before {
    top: 2px;
    right: 2px;
    border-width: 1px 1px 0 0;
  }

  &::after {
    bottom: 2px;
    left: 2px;
    border-width: 0 0 1px 1px;
  }

  &:hover {
    &::before {
      top: 0px;
      right: -1px;
    }

    &::after {
      bottom: -1px;
      left: -1px;
    }
  }
}