web-components icon indicating copy to clipboard operation
web-components copied to clipboard

Add even/odd parts to grid details

Open javier-godoy opened this issue 1 year ago • 1 comments

Describe your motivation

The details cell does not have even-odd parts applied, so it's not possible to write the following style with part selector

:host [part~="odd-row"] [part~="details-cell"] {background: red}
:host [part~="even-row"] [part~="details-cell"] {background: blue}

image

Describe the solution you'd like

I would like an even/odd part to be applied to the details <td> (or maybe even-details/odd-details for compatibility), so that I can write vaadin-grid::part(odd-row details-cell) {background: red}

Describe alternatives you've considered

No response

Additional context

No response

javier-godoy avatar Mar 15 '24 18:03 javier-godoy

This is actually achievable using style properties in V24. The cell background (including the details cell) can be styled with --vaadin-grid-cell-background so you can do

vaadin-grid::part(odd-row) {
  --vaadin-grid-cell-background: red;
}```

rolfsmeds avatar Mar 21 '24 14:03 rolfsmeds