JSFiddle - React, Tailwind, and code Playground

by Abdul Ahmad

HTML

<div class='button-container'>
  <div class='button'>
    hover
  </div>
</div>

SCSS

.button-container {
  display: inline-block;
  
  &:hover {
    .button {
      top: -5px;
      transition: top 0.15s ease;
    }
  }
}

.button {
  padding: 10px 20px;
  background: teal;
  color: white;
  border-radius: 5px;
  position: relative;
  top: 0px;
  transition: top 0.2s ease;
}