Browse documentation
Reference / Variants & accessibility
Child and descendant selectors
Style direct children with * or all descendants with **. An arbitrary selector can target a particular element within component markup.
Working example
- Fold the signature.
- Press the seam.
The ampersand stands for the element carrying the class. An underscore in an arbitrary selector becomes a space, so [&_strong] reaches nested strong elements.
<ul class="border px-3 *:py-2 [&_strong]:underline">
<li><strong>Fold</strong> the signature.</li>
<li><strong>Press</strong> the seam.</li>
</ul>Class reference
| Class | CSS declarations |
|---|---|
*:p-2 | padding: 0.5rem; |
**:font-sans | font-family: ui-sans-serif, system-ui, sans-serif; |
[&_strong]:underline | text-decoration-line: underline; |
[&>li]:border-b | border-bottom-width: 1px; |
View full generated CSS
.\*\*\:font-sans * {
font-family: ui-sans-serif, system-ui, sans-serif;
}
.\*\:p-2 > * {
padding: 0.5rem;
}
.\[\&_strong\]\:underline strong {
text-decoration-line: underline;
}
.\[\&\>li\]\:border-b>li {
border-bottom-width: 1px;
}