Everything on selectors.
3 articles tagged selectors, sorted newest first.
Tailwind v4 nth-* Variants: Striped Tables and Staggered Lists Without a Plugin
Styling every third card used to mean an arbitrary selector or a community plugin. Tailwind v4 ships nth-* as core variants — here is the compiled CSS for each form and the three ways people get them wrong.
Style State with Tailwind v4 data-* and aria-* Variants
Open, closed, loading, selected — each state ends up as another ternary in a `:class` string. Tailwind v4 lets you toggle one attribute and style it with a variant instead.
Style the Exception with Tailwind v4's not-* Variant
CSS negation used to mean a base style plus a `:last-child` override. Tailwind v4's `not-*` variant compiles to `:not()` so you state the exception in one utility.