September 2017
Intermediate to advanced
450 pages
11h 24m
English
With Sass nesting, we can actually "nest" the navigation link selector inside the nav element's own style declarations:
a { font-size: 14px; text-decoration: underline; color: $text-color;}nav { background-color: $text-color; a { color: $background-color; }}
This results in a link element that has a different color than other links, but still inherits other properties, such font-size and underline. This works because Sass essentially compiles to three different CSS selectors for us.
a { font-size: 14px; text-decoration: underline; color: #585858; }nav { background-color: #585858; }nav a { color: #E8E8E8; }
We can also use nesting for other things than just selector specificity; we can use it as a convenient way to qualify ...
Read now
Unlock full access