You’re referring to a Tailwind CSS utility-like shorthand: py-1 [&>p]:inline.
Explanation:
- py-1 — sets vertical padding (padding-top and padding-bottom) to 0.25rem (Tailwind’s spacing scale 1).
- [&>p]:inline — a Tailwind JIT arbitrary selector that applies the
inlinedisplay to direct childelements (the selector is
& > p).
Behavior together:
- The element gets small vertical padding.
- Any direct child
becomes display: inline; (so its block behavior is removed; margins, line breaks, and width behave like inline content).
Notes:
- Requires Tailwind JIT / arbitrary variants support.
- The exact spacing value depends on your Tailwind config if customized.
- [&>p]:inline → for nested, use
[&_:where(p)]:inlineor a different selector.
Leave a Reply