p]:inline” data-streamdown=”list-item”>SendTo-Convert: Fast File Conversion from Your Context Menu

You’re asking about the CSS selector-like pattern py-1 [&>p]:inline. This is a utility/class pattern used in Tailwind CSS (or Tailwind-style utility libraries) combining a spacing utility with a variant that targets direct child

elements. Explanation:

  • py-1 Tailwind utility that applies padding-top: 0.25rem and padding-bottom: 0.25rem (assuming default config; 1 0.25rem).
  • [&>p]:inline A “selector variant” using Tailwind’s arbitrary variants syntax. It compiles to a rule that applies when the element’s direct child p matches; specifically it targets the current element but only when its direct child p is styled as inline, or more precisely it generates a selector like:
    .your-class[&>p]:inline { display: inline; }
    In Tailwind v3 arbitrary variants, [&>p]:inline means “apply the inline utility (display: inline) to the element when the selector &>p matches”, where & is the element itself and >p is a direct child paragraph selector. Practically this produces CSS equivalent to:
    .py-1&p&>p:inline > p { display: inline; }
    (Exact emitted selector can vary; the intended effect is to set the direct child

    to display:inline.)

Putting them together on an element like:

Text

  • The div gets vertical padding of 0.25rem.
  • The direct child

    is set to display:inline due to the arbitrary variant.

    Notes:

    • Make sure your Tailwind config allows arbitrary variants (Tailwind v3+).
    • If you want to target all descendant p (not only direct children), use [&_p]:inline or [&:where(p)]:inline patterns depending on desired specificity.
    • For more predictable output you can also write a custom plugin or use > p:inline if using a plugin that provides child variants.

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *