JSFiddle - React, Tailwind, and code Playground

HTML

<a href="#" data-value="button 1" class="button"></a>
<a href="#" data-value="dwójka" class="button"></a>
<a href="#" data-value="numer trzeci" class="button"></a>

CSS

.button {
    display: inline-block;
    position: relative;
    line-height: 25px;
    background: linear-gradient(#3870b5, #0e2849);
    color: #fff;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    border: none;
    border-radius: 3px;    
    width: 100px;
    height: 25px;
}

.button:before {
    background: linear-gradient(#de4848, #bc2929);
    border: none;
    border-radius: 3px;
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 0px;
    transition: width 0.5s ease;
}

.button:hover:before {
    width: 100px;
}

.button:after {
    content: attr(data-value);
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
}