I am struggling to change the color of the inner text to white when hovering. I tried using ::before:hover but even though the entire div changes, the text remains black. What could be causing my code not to work?
.feature {
.feature-rect {
position: relative;
height: 180px;
width: 270px;
border-radius: 20px;
background-color: $light-color;
@include box-shadow($form-shadow);
text-align: center;
margin-bottom: 30px;
padding: 20px;
z-index: 1;
display: block;
}
.feature-rect::before {
position: absolute;
content: "";
top: 0;
right: 0;
bottom: 0;
left: 0;
background: linear-gradient(180deg, #232153 0%, #6F2365 100%);
z-index: -1;
transition: opacity 0.5s linear;
opacity: 0;
border-radius: 20px;
display: block;
color: #fff;
cursor: pointer;
}
.feature-rect:hover::before {
opacity: 1;
}
.feature-rect:hover{
color:#fff;
}
}
<div class="feature">
<div class="feature-rect">
<img src="{{ config('static.images') }}images/card_feature_icon_2.png">
<div class="title-light-color-font-s mt-10">Lorem Ipsome</div>
<div class="title-content-font-xs mt-10">Lorem Ipsome Lorem Ipsome Lorem Ipsome Lorem Ipsome</div>
</div>
</div>