[csswg-drafts] [css-selectors] nth-child produces a local variable

Nokel81 has just created a new issue for https://github.com/w3c/csswg-drafts:

== [css-selectors] nth-child produces a local variable ==
Currently you can write the following with the `:nth-child` or similar style selectors
```css
.foobar>*:nth-child(2n) {
    background-color: lime;
}
```

Which means that every second child has a background colour of lime. However you cannot do something like the following:

```css
.foobar {
    display: grid;
    grid-template-columns: 100px 1fr;
}
.foobar>*:nth-child(2n) {
    grid-column: 1/2;
    grid-row: n;
}
.foobar>*:nth-child*(2n+1) {
    grid-column: 2/3;
    grid-row: n;
}
```

I think that this would be very useful and would make working with grids quite a bit more easy

Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/1869 using your GitHub account

Received on Friday, 13 October 2017 22:28:08 UTC