JSFiddle - React, Tailwind, and code Playground

HTML

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

CSS

.button {
    display: inline-block;
    position: relative;
    line-height: 25px;
    color: #fff;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    border: none;
    border-radius: 3px;    
    width: 100px;
    height: 25px;
    overflow: hidden;
}

.button:before, .button:after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.button:before {
    z-index: -2;
    background: linear-gradient(#3870b5, #0e2849);
}

.button:after {
    z-index: -1;
    background: linear-gradient(#de4848, #bc2929);
    width: .01%;
    transition: width 0.5s ease;
}

.button:hover:after {
    width: 100%;
}