grid
grid copied to clipboard
Feature request: alternating row background color
Please enlighten me if currently there is any workaround for having rows in alternating background color!
Hello @universallyleo , To customize the default styles please use rowStyle property.
Here is the example: https://stackblitz.com/edit/sveltejs-kit-template-default-e8r1phug?file=src%2Froutes%2FMyGrid.svelte
Thank you for pointing this out, I then tried setting rowStyle, which does work other styles (e.g. text color) apart from background color. After some inspection, it turns out that I have to change --wx-background in .wx-row instead, so the following work for me.
:global(.wx-row:nth-child(even)) {
--wx-background: hsl(0, 0%, 97%);
}