I am currently making a Star Rating component for our website, I use angular11 (should not matter I think), so far I have the rendering of the 5 stars depending on the current rating value and such, but I struggle to get the styling for the hovering correct.
Basicly for example if I have 2 out of 5 stars and I hover the 4th star the 3th should be filled too. I struggle to find the correct css to achieve that Thats what I got so far in CSS
.rating-icon-empty { fill: #9e9e9e }
.rating-icon { fill: #7C4DFF; margin-right: 5px; }
.editable .rating-icon-empty:hover { fill: #7C4DFF; cursor: pointer;}
My current CSS only fills the star that is hovered but not the previous unfilled stars.
Is there a way to achieve this with pure CSS or do I need to rely on hover listeners for each star?