Skip to main content

Arrow Transition Effect (Arrow longer on hover)

a.uk-button-default {
    position: relative;
}


.uk-section-primary:not(.uk-preserve-color)  .uk-button-default:before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    right: 10px;
    width: 80px;
    background-image: url(/wp-content/icons/arrow-white.svg);
    background-repeat: no-repeat;
    background-position: calc(100% - 20px) 50%;
    transition: background-position .2s ease-out;
}


.uk-section-primary:not(.uk-preserve-color) .uk-button-default:hover::before {
    background-image: url("/wp-content/icons/arrow-white.svg");
    background-position: 100% 50%;
}


.uk-button-default:before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    right: 10px;
    width: 80px;
    background-image: url(/wp-content/icons/arrow-green.svg);
    background-repeat: no-repeat;
    background-position: calc(100% - 20px) 50%;
    transition: background-position .2s ease-out;
}


.uk-button-default:hover::before {
    background-image: url("/wp-content/icons/arrow-white.svg");
    background-position: 100% 50%;
}

.uk-button-default:active::before {
    background-image: url("/wp-content/icons/arrow-green.svg");
    background-position: 100% 50%;
}

.uk-button-default {
    padding-right: 100px;
    transition: 0.3s;
}

.uk-button-default:hover {
    padding-left: 40px;
    transition: 0.4s;
    padding-right: 110px;
}

Used on Pro Mini Bikes website.

Leave a Reply

Your email address will not be published. Required fields are marked *