Csswg-drafts: [css-nth-child] Take care about :not() selector

Created on 10 Sep 2019  路  4Comments  路  Source: w3c/csswg-drafts

Hello,
It should be nice if :nth-child can take care about :not() (and/or other) selector.

I work on embedded system and when a "table" is displayed it better to filter element only on client side with some display:block/none instead of redraw the full "table" with or without request to the backend.

Today if we want to color odd lines in blue and even lines in green, it's works when the full table is displayed but not when we filtered and hidden some line.

https://codepen.io/Ygles/pen/aboYLQE

Today more embedded system used WEB technology for MMI but the network or the system is not as powerfull as standard computer.

Regards

Nicolas PILLON

Most helpful comment

There is the of S syntax for this: :nth-child(even of :not(.hidden)).
https://drafts.csswg.org/selectors-4/#the-nth-child-pseudo
But is seems it's only supported by Safari right now.

All 4 comments

There is the of S syntax for this: :nth-child(even of :not(.hidden)).
https://drafts.csswg.org/selectors-4/#the-nth-child-pseudo
But is seems it's only supported by Safari right now.

Thanks do you know if the support is on the others browser roadmap ?

Yes. In Blink, of S will likely follow after :where and :is.

Tkanks

Was this page helpful?
0 / 5 - 0 ratings