JSFiddle - React, Tailwind, and code Playground

HTML

<div class="container">
  <p class="text">Lorem ipsum dolor sit.</p>
</div>

CSS

.container {
    display: flex;

    width: 100%;
    min-height: 500px;

    justify-content: center;
    align-items: center;
}

.text {
    font-size: 28px;

    position: relative;

    cursor: pointer;
    text-transform: uppercase;
}

.text::before,
.text::after {
    position: absolute;
    bottom: 0;

    height: 2px;

    content: '';
    transition: all 2s;

    background-color: blue;
}

.text::before {
    right: 0;

    width: 50%;
}

.text::after {
    left: 0;

    width: 50%;
}

.text:hover:before,
.text:hover:after {
    width: 0;
}