Try something like:
.light, .light-bold, .white, .white-bold {.header-nav a::before {
content: '';
position: absolute;
bottom: -1px; /* Adjust this value to position the underline */
left: 0;
width: 0;
height: 2px; /* Adjust this value for the underline thickness */
background-color: #000; /* Adjust this value for the underline color */
transition: width 0.3s ease; /* Animation duration and timing function */
}
}
.dark, .dark-bold, .black, .black-bold {.header-nav a::before {
content: '';
position: absolute;
bottom: -1px; /* Adjust this value to position the underline */
left: 0;
width: 0;
height: 2px; /* Adjust this value for the underline thickness */
background-color: #fff; /* Adjust this value for the underline color */
transition: width 0.3s ease; /* Animation duration and timing function */
}
}
/* Trigger animation on hover */
.header-nav a:hover::before {
width: 100%;
}