Most of my small projects no longer need Sass just to write a nested rule.
.card {
padding: 1rem;
& h2 { margin: 0; }
&:hover { box-shadow: 0 2px 8px #0003; }
@media (width >= 40rem) { padding: 2rem; }
}
Plain CSS now accepts rules inside other rules. & stands for the parent selector, so &:hover means .card:hover, and media queries can sit right next to the declarations they change. The relaxed syntax, where a nested type selector like h2 needs no &, is in all current browsers since December 2023. Nested rules do add the parent’s specificity, as :is() would, so a deep nest gets heavy quickly.
Further reading: MDN: CSS nesting