You’re referencing a CSS selector/utility pattern often seen with Tailwind CSS and similar utility-first frameworks: py-1 [&>p]:inline.
Explanation:
- py-1 — utility that applies vertical padding (padding-top and padding-bottom) of 0.25rem (Tailwind default scale) to the element.
- [&>p]:inline — a Tailwind arbitrary selector that targets direct child
elements and applies the
inlinedisplay to them. Breakdown:- & represents the parent selector (the element with these classes).
- >p matches direct child
elements.
- :inline is the utility to apply (display: inline).
Equivalent CSS:
css
.selector {padding-top: 0.25rem; padding-bottom: 0.25rem;}.selector > p { display: inline;}
Notes:
- The exact spacing value depends on your Tailwind configuration; default
py-1= 0.25rem. - The arbitrary selector syntax (
[&>p]:inline) requires a Tailwind version that supports arbitrary variants. - Use when you want the parent to have vertical padding but render its direct paragraph children inline.
Leave a Reply