Open webJose opened 6 months ago
By the way, the workaround is easy, I suppose:
div.grid-row {
display: flex;
flex-direction: row;
gap: $tableGap;
padding: 0.2em 0em;
&.row-highlight {
&:hover, &.hover {
background-color: rgba(0, 0, 0, var(--wjg-rowhightlight-bg-opacity));
div.grid-cell-bg.sticky-data > :global(div.grid-cell) { // WORKAROUND: USING :global()
background-color: rgba(0, 0, 0, var(--wjg-rowhightlight-bg-opacity));
}
}
}
}
Describe the bug
Ok, this is going to be difficult for me because I'm not front-end dev. Maybe the bug is not a bug but an error on my side. The summary: In SveteKit + svelte@5.0.0-next.127, I use a CSS class named
grid-cell
that doesn't have "explicit" setting in the script's style tag, but it is used in a very specific selector:div.grid.row.row-highlight:hover div.grid-cell-bg.sticky-data > div.grid-cell
. There it is. Apparently, this usage is not enough for Svelte to add the scoping class to those DIV's. The structure is: div.grid-container > div.grid > div.grid-body > div.grid-row-bg > div.grid-row > div.grid-cell-bg > div.grid-cell. That's the markup the component specifies. That last DIV, when inspected in the browser, doesn't have the scoping class.Just in case it isn't clear: The compiled CSS adds the scoping class to the big selector above. If I inspect the div.grid-cell element and manually add the scoping class, then the style is applied.
Reproduction
I currently cannot sit down to make a small repro, so I figured I should post the entire component. It is a bit over 200 lines (not much, right?). It is a table component made out of DIV's.
Logs
No response
System Info
Severity
blocking an upgrade