Explanation of the CSS utility classes
- list-inside — Places list markers (bullets/numbers) inside the content box so markers flow with text and wrap to the next line instead of hanging outside.
- list-disc — Uses a solid disc (filled circle) as the list marker (applies to ul).
- whitespace-normal — Collapses whitespace and allows lines to wrap normally.
- [li&]:pl-6 — A Tailwind CSS arbitrary variant targeting each li element: it applies padding-left: 1.5rem (pl-6) to the list item itself. The selector expands to something like li: where the ampersand (&) represents the matched element; in practice this compiles to a rule that adds left padding on each li.
Combined behavior
- &]:pl-6” data-streamdown=“unordered-list”>
- Bullets appear inside the list item box and wrap with the text.
- Each li gets 1.5rem left padding, pushing content (including the bullet when inside) to the right.
- Normal whitespace handling means text wraps and consecutive spaces collapse.
Example HTML
html
<ul class=“list-inside list-disc whitespace-normal [li&]:pl-6”><li>First item with long text that will wrap onto multiple lines to show how the bullet and padding behave.</li> <li>Second item</li></ul>
Notes
- &]:pl-6” data-streamdown=“unordered-list”>
- Some build setups require enabling arbitrary variants in Tailwind; verify your Tailwind version supports the [selector]:utility syntax.
- list-outside instead of
list-inside._
Leave a Reply