The problem with this is, it is not hovering the entire row as you see below
I want the entire row to be colored when hovering. From the doc I see there is a style selector vaadin-grid::part(row):hover which is not having any effect when I replace the above with row.
It’s slightly more involved. The background color needs to be changed on the cells, like in your solution, but the hover state needs to be observed on the row, where we set the custom property that controls the cell background.
And to cover the case if you have frozen/fixed columns, and other columns can be scrolled underneath them, we need to set both a background image (the linear-gradient with the semi-transparent 10% contrast color) and a background color (the opaque/solid base color).
The transition isn’t going to work with the background image directly. I didn’t have time to think about how to make that work.
In Vaadin 24 we have --vaadin-grid-cell-background CSS property and solution by @Jouni1 is preferable, this was not present in Vaadin 23 or 14, so for sake of completeness I leave here alternative solution for those who are still using older version.
The problem with setting the row background is, that when scrolling to the right, the row cuts off at some point and the hovering effect is lost.
I had a similar issue some time ago, where the only solution with pure css was to use shadow dom styling with adding the following snippet to themes/your-theme/components/vaadin-grid.css
The usage of light dom styling / ::parts is the recommended way. But as I said, it will lead to displayment issues, when you have a grid with scrollable content, so the alternative way of shadow dom styling (which is also a Vaadin styling method, even if it is discouraged as the first choice) is more likely the way for you to go.
But in the end, you have all the variants presented, try it out and see which way works the best for you