Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save ackernaut/951d9dcae12e400065b409bcea5d2750 to your computer and use it in GitHub Desktop.
Save ackernaut/951d9dcae12e400065b409bcea5d2750 to your computer and use it in GitHub Desktop.
:first-child i === 0
:last-child i === arr.length - 1
:only-child arr.length === 1
:nth-child(even) i % 2
:nth-child(odd) !(i % 2)
:nth-child(n) i === n - 1
:nth-last-child(n) i === arr.length - n
:nth-child(-n+3) i < 3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment