You’re referencing a Tailwind CSS utility and variant selector: py-1 [&>p]:inline.
- py-1: sets vertical padding (padding-top and padding-bottom) to Tailwind’s spacing
1(typically 0.25rem / 4px by default). - [&>p]:inline: uses Tailwind’s arbitrary variant to target direct child
elements and apply the
inlinedisplay to them. The&represents the current selector, so&>pcompiles to.your-class > p.
Combined effect (on an element with these classes):
- The element receives small vertical padding.
- Any direct child
elements are set to display: inline.
Notes:
- Arbitrary variants require a Tailwind version that supports them (v3+).
- If you need to target all descendant
instead of only direct children, use
[&_p]:inlineor[&>p]:inlinedepending on desired specificity;[&_p]targets descendants when Tailwind’s configured separator supports it.
Leave a Reply