Shadowing the row when hovered is generally easy:
tr:hover {
background-color: $light-grey;
}
But I would like to shadow the whole row only if it is the last cell that is hovered. For any other cell I do not want it to be shadowed. Let's assume:
<tr>
<td></td>
<td></td>
<td class="w"></td>
<tr>
I would like the tr to be shadowed (background-color changed) only when column w
(first cell in a row) is hovered. It can be done with js:
$(".w").on("hover",(e) => {
$(e.target).parent().addClass("highlight");
});
.highlight {
background-color: $light-grey;
}
But can that be achieved with scss only?