From the course: Sass Essential Training
Unlock the full course today
Join today to access over 23,100 courses taught by industry experts.
Nesting - Sass Tutorial
From the course: Sass Essential Training
Nesting
- SASS allows you to place rules inside other rules. Now this is known as nesting and it makes organizing complex rules a lot easier. Here's what nesting looks like. This is one of the best features in SASS that as of this recording, hasn't been added to CSS. It combines rules and helps you organize things a little bit better. However, you must be careful because a lot of nesting will create a lot of extra CSS which can get quite complex. Now since SASS is compiled, a lot of nested rules can also mean that the CSS will take longer to generate. So you should try as much as possible to keep your rules simpler. Let's take a look at how this works in action. Here I'm creating a headline with a paragraph underneath and then I'm adding another section here called box, that has another headline. It's the same level as this headline rate here, with a paragraph inside it. Now the CSS first declares the value of the headline…