You’re asking about the CSS selector fragment py-1 [&>p]:inline. This looks like Tailwind CSS (or a Tailwind-like utility) using JIT arbitrary variants. Explanation:
- py-1: Applies vertical padding (padding-top and padding-bottom) of 0.25rem (Tailwind default spacing scale step 1).
- [&>p]:inline: An arbitrary variant using the parent selector
&to target direct childelements and apply the
inlineutility to them. In effect, it setsdisplay: inline;on every immediatechild of the element with these classes.
Combined behavior: the element gets small vertical padding, and any direct child
becomes inline (so paragraphs will flow inline rather than block). Example HTML:
<div class=“py-1 [&>p]:inline”><p>First</p> <p>Second</p></div>
Rendered result: the container has vertical padding 0.25rem; the two
elements render inline next to each other instead of on separate lines.
Notes/compatibility:
- Requires Tailwind CSS v3+ (JIT) or a build setup that supports arbitrary variants.
- The arbitrary variant syntax must be enabled and not blocked by your linter/config.
- If you want to target all descendant
, use
[&_p]:inlineor[&>_p]:inlinedepending on your Tailwind version and conventions; exact syntax varies—use direct-child>as shown for immediate children.
Leave a Reply