pascalduez / postcss-quantity-queries

PostCSS plugin enabling quantity-queries
The Unlicense
114 stars 4 forks source link

Parity (odd/even) feature #11

Open woble opened 8 years ago

woble commented 8 years ago
/* Check if there's an even number of children */
.element:nth-last-child(even):first-child,
.element:nth-last-child(even):first-child ~ .element {
    ...
}

/* Check if there's an odd number of children */
.element:nth-last-child(odd):first-child,
.element:nth-last-child(odd):first-child ~ .element {
    ...
}

I suppose the syntax can be :total-even and :total-odd.

pascalduez commented 8 years ago

Hi,

why not, I can think of real world usages for this. I'm in the (slow) process of re-factoring the code base to tackle #8. So this would happen next.