PowerDVD

list-inside list-decimal whitespace-normal [li&]:pl-6

This article explains the CSS utility-like class combination shown in the title: what each part does, when to use it, and how to implement equivalent styles in plain CSS. It’s written assuming a utility-first framework (like Tailwind) or a custom utility naming scheme, then shows vanilla-CSS alternatives and practical examples.

What the pieces mean

    &]:pl-6” data-streamdown=“unordered-list”>

  • list-inside Place list markers (bullets or numbers) inside the content box so markers align with the first line of the list item instead of outside the content box.

    • CSS: list-style-position: inside;
  • list-decimal Use decimal numbers for ordered lists (1, 2, 3…).

    • CSS: list-style-type: decimal;
  • whitespace-normal Collapse whitespace and allow wrapping normally (opposite of nowrap or pre behaviors).

    • CSS: white-space: normal;
  • [li&]:pl-6 A bracketed arbitrary selector targeting li elements in a specific nested or contextual pattern, applying left padding (pl-6 typically means padding-left: 1.5rem in Tailwind). The notation [li&]:pl-6 implies a variant that targets an element when it is the parent of an li matching some selector; interpreted concretely, it can mean “when this component contains an li (styled as &), apply padding-left: 1.5rem to that li.” In plain CSS you’d target li directly or use a contextual selector.

    • Example Tailwind-like utility: .pl-6 { padding-left: 1.5rem; }
    • Targeting li in CSS: ol li { padding-left: 1.5rem; } or .my-list li { padding-left: 1.5rem; }

Combined effect

Applied together to an ordered list, these rules produce a numbered list whose numbers sit inside the content flow, whose items wrap normally, and whose list items have left padding so text aligns visually with additional indentation.

Example (utility-first HTML)

html
<ol class=“list-inside list-decimal whitespace-normal”><li class=“pl-6”>First item that may wrap to multiple lines and aligns with the number.</li>  <li class=“pl-6”>Second item with normal wrapping behavior and added left padding.</li></ol>

Equivalent plain CSS

css
.custom-list {  list-style-position: inside;  list-style-type: decimal;  white-space: normal;  padding-left: 0; /* reset if framework added default /}
.custom-list li {  padding-left: 1.5rem; / matches pl-6 */}
html
<ol class=“custom-list”>  <li>First item that may wrap to multiple lines and aligns with the number.</li>  <li>Second item with normal wrapping behavior and added left padding.</li></ol>

Accessibility and layout notes

  • Using list-style-position: inside can cause markers to wrap with content on narrow screens; if marker alignment is critical, prefer outside and use padding/margins to align.
  • Padding on li affects the whole item; consider using margins on nested content instead if you only want indentation for wrapped lines.
  • Test with screen readers—semantic
      /

    1. remains important; these visual utilities should not alter list semantics.

When to use this pattern

  • When you need numbered lists where multi-line items visually align under the number.
  • In prose-heavy designs where natural wrapping is required.
  • When using utility frameworks and you want a compact class set to control list appearance.

Quick checklist

  • Use list-inside for numbers inside flow.
  • Use list-decimal for numeric markers.
  • Use whitespace-normal to allow wrapping.
  • Apply pl-6 (or equivalent padding) to li for consistent indentation.

That’s the practical breakdown and implementation options for the title’s utility combination._

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