Skip to content

Commit 37db203

Browse files
author
Stefanie Hein
committed
List-View: fix issue with hovering over a list-view row, now the whole row including the drag handle will show the background color on hover, this is now possible due to wide :has() support in browsers. See #68701
1 parent 9fabf66 commit 37db203

File tree

1 file changed

+21
-5
lines changed

1 file changed

+21
-5
lines changed

src/scss/themes/fylr/components/_list-view.scss

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -397,11 +397,27 @@
397397
}
398398

399399
// Special case, when there is a single column in the quadrant-2 that contains only the drag handle
400-
// we do not want it to have a hover effect, because it just looks weird when the hover effect applies to
401-
// the drag handle and the actual row SEPERATELY, therefore we rather hide the hover for the drag handle column
402-
.cui-list-view-grid-fixed-col-has-only-row-move-handle {
403-
.cui-list-view-grid-quadrant-2 {
404-
--list-view-hover-row-background: transparent;
400+
// --
401+
// With :has() selector we can select one column and change the background whenever the related column is hovered.
402+
// Since we need to reference the related row by the row number, we need to generate a selector
403+
// for as many rows
404+
.cui-list-view-grid-fixed-col-has-only-row-move-handle {
405+
.cui-list-view-grid-inner-bottom {
406+
@for $row from 1 through 100 {
407+
// hover over a CONTENT column will adjust the related HANDLE column
408+
&:has(.cui-list-view-grid-quadrant-3 .cui-list-view-row-selectable[row='#{$row}']:hover) {
409+
.cui-list-view-grid-quadrant-2 .cui-list-view-row-selectable[row='#{$row}'] .cui-lv-tr {
410+
background-color: var(--list-view-hover-row-background);
411+
}
412+
}
413+
414+
// hover over a HANDLE column will adjust related CONTENT column
415+
&:has(.cui-list-view-grid-quadrant-2 .cui-list-view-row-selectable[row='#{$row}']:hover) {
416+
.cui-list-view-grid-quadrant-3 .cui-list-view-row-selectable[row='#{$row}'] .cui-lv-tr {
417+
background-color: var(--list-view-hover-row-background);
418+
}
419+
}
420+
}
405421
}
406422
}
407423

0 commit comments

Comments
 (0)