Last active
September 22, 2015 18:27
-
-
Save cameronscott137/8ad5943921fa30dbbd66 to your computer and use it in GitHub Desktop.
Nesting Examples
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Right | |
.navbar li a:hover{} | |
.header .left-nav{} | |
// Wrong | |
.navbar{ | |
li{ | |
a{ | |
&:hover{ | |
} | |
} | |
} | |
} | |
.header{ | |
.left-nav{ | |
} | |
} | |
//Nesting with pseudo-classes, psuedo-elements, and media queries | |
.navbar a{ | |
@include media(min-width $screen-nav){ | |
&:after{ | |
} | |
&:hover{ | |
&:after{ | |
}//after | |
}//hover | |
}//media | |
}//navbar | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment