CSS nesting

Writing CSS rules inside other rules so they apply to descendants or variants, a feature browsers now support natively.

In more detail

The & stands for the parent selector. Native nesting removes the need for a preprocessor just to group related rules.

Example

.card { & img { border-radius: 8px; } }

Related terms

Taught in

References