Skip to content

Instantly share code, notes, and snippets.

@cameronscott137
Last active September 22, 2015 18:27
Show Gist options
  • Save cameronscott137/8ad5943921fa30dbbd66 to your computer and use it in GitHub Desktop.
Save cameronscott137/8ad5943921fa30dbbd66 to your computer and use it in GitHub Desktop.
Nesting Examples
// 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