Closed Eric-Arellano closed 1 year ago
Sass allows nesting:
When writing HTML you’ve probably noticed that it has a clear nested and visual hierarchy. CSS, on the other hand, doesn’t. Sass will let you nest your CSS selectors in a way that follows the same visual hierarchy of your HTML.
When writing HTML you’ve probably noticed that it has a clear nested and visual hierarchy. CSS, on the other hand, doesn’t.
Sass will let you nest your CSS selectors in a way that follows the same visual hierarchy of your HTML.
E.g.
nav { ul { margin: 0; padding: 0; list-style: none; } li { display: inline-block; } }
vs.
nav ul { margin: 0; padding: 0; list-style: none; } nav li { display: inline-block; }
This cleans up some of our hard-to-read selectors.
Sass allows nesting:
E.g.
vs.
This cleans up some of our hard-to-read selectors.