<div class="gradient">Hover Me (^_^)!!!</div>
<div class="gradient__css__custom">Hover Me (^_^)!!!</div>
@import url("https://fonts.googleapis.com/css2?family=Exo:wght@600&display=swap");

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  width: 100vw;
  min-height: 100vh;
  font-family: "Exo", Arial, sans-serif;
  background-color: #222;
  color: #fff;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 1.5rem;
  gap: 10px;
}

div {
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 10rem;
  padding: 10px 30px;
  min-height: 90px;
  cursor: pointer;
}

.gradient {
  background-image: linear-gradient(to right, #0f9, #09f);
  transition: all 0.28s linear;
}

.gradient:hover {
  color: #f36;
  background-image: linear-gradient(to right, #09f, #0f9);
}

.gradient__css__custom {
  --colorStar: #ff9500;
  --colorStop: #b320b0;
  background-image: linear-gradient(
    to right,
    var(--colorStar),
    var(--colorStop)
  );
  transition: --colorStart 0.28s linear, --colorStop 0.28s linear;
}

.gradient__css__custom:hover {
  background-image: linear-gradient(
    to right,
    var(--colorStop),
    var(--colorStar)
  );
}

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.