Nice writeup. I haven't used less in years, it is nice to see some preprocessor content.
A simpler, pure css way of Odd and Even would be :nth-child(2n+1):nth-child(2n+2).
Ideally, simple 2n should work for even rows but 2n+2 has been quite popular due to some reason I don't know about.
W3.org article on even-odd uses col:first-childcol:nth-child(2n+3) it still works as expected and I have used it a few times in project.
Unfortunately those are even odd sibling selectors, inherit() needs even odd depth selectors, so it's a little bit more work. Thank you for checking it out though!
Some comments have been hidden by the post's author - find out more
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Nice writeup. I haven't used less in years, it is nice to see some preprocessor content.
A simpler, pure css way of Odd and Even would be
:nth-child(2n+1)
:nth-child(2n+2)
.Ideally, simple 2n should work for even rows but 2n+2 has been quite popular due to some reason I don't know about.
W3.org article on even-odd uses
col:first-child
col:nth-child(2n+3)
it still works as expected and I have used it a few times in project.Unfortunately those are even odd sibling selectors, inherit() needs even odd depth selectors, so it's a little bit more work. Thank you for checking it out though!