tailwindcss icon indicating copy to clipboard operation
tailwindcss copied to clipboard

Add `nth-*` variants

Open thecrypticace opened this issue 1 month ago • 0 comments

This adds variants for the :nth-child(), :nth-last-child(), :nth-of-type(), and :nth-last-of-type() pseudo classes. These variants support arbitrary values as well as numeric bare values. Refer to the table below for example usasges on what selectors these variants produce:

Variant Selector
nth-3:* &:nth-child(3)
nth-[2n+1]:* &:nth-child(2n+1)
nth-[2n+1_of_.item]:* &:nth-child(2n+1 of .item)
nth-last-3:* &:nth-last-child(3)
nth-last-[2n+1]:* &:nth-last-child(2n+1)
nth-last-[2n+1_of_.item]:* &:nth-last-child(2n+1 of .item)
nth-of-type-3:* &:nth-of-type(3)
nth-of-type-[2n+1]:* &:nth-of-type(2n+1)
nth-last-of-type-3:* &:nth-last-of-type(3)
nth-last-of-type-[2n+1]:* &:nth-last-of-type(2n+1)

thecrypticace avatar May 08 '24 22:05 thecrypticace