AltoCode

Piedimulera

HTML


<a href="" class="cs-button-12">Prenota Ora
    <picture class="cs-button-wrapper">
        <img class="cs-button-icon" src="https://csimg.nyc3.cdn.digitaloceanspaces.com/Images/Icons/angle-arrow.svg" alt="icona freccia" loading="lazy" decoding="async" width="28" height="28">
    </picture>
</a>

CSS


.cs-button-12 {
  font-size: 1rem;
  line-height: clamp(2.875rem, 8vw, 3.5rem);
  text-decoration: none;
  font-weight: 700;
  margin: auto;
  color: #fff;
  background-color: var(--primary);
  padding: 0 0 0 1.5rem;
  box-sizing: border-box;
  display: inline-flex;
  justify-content: center;
  align-items: stretch;
  gap: 1.5rem;
  position: relative;
  z-index: 1;
  transition: background-color 0.3s;
}
.cs-button-12:hover {
  background-color: #1a1a1a;
}
.cs-button-12:hover .cs-button-wrapper:before {
  height: 100%;
}
.cs-button-12:hover .cs-button-icon {
  filter: grayscale(1) brightness(1000%);
}
.cs-button-12 .cs-button-wrapper {
  width: 3.5rem;
  background-color: #E8E8E8;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  z-index: 1;
  transition: transform 0.3s, background-color 0.3s;
}
.cs-button-12 .cs-button-wrapper:before {
  content: '';
  width: 100%;
  height: 0%;
  background: var(--primary);
  opacity: 1;
  position: absolute;
  display: block;
  bottom: 0;
  left: 0;
  z-index: -1;
  transition: height 0.3s;
}
.cs-button-12 .cs-button-icon {
  width: 1.75rem;
  height: auto;
  display: block;
}