Skip to content

Instantly share code, notes, and snippets.

@jayroh
Created June 29, 2011 02:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save jayroh/1052807 to your computer and use it in GitHub Desktop.
Save jayroh/1052807 to your computer and use it in GitHub Desktop.
The ampersand
/* scss */
#nav {
li a {
color: maroon;
body.admin & { border-bottom: dotted 1px maroon; } // <-- Awesome-sauce right there
&:hover {
color: purple;
}
}
}
/* output */
#nav li a { color: maroon; }
body.admin #nav li a { border-bottom: dotted 1px maroon; }
#nav li a:hover { color: purple; }
/* scss */
#nav {
li a {
color: maroon;
&:hover {
color: purple;
}
}
}
body.admin #nav li a { border-bottom: dotted 1px maroon; }
/* output */
#nav li a { color: maroon; }
#nav li a:hover { color: purple; }
body.admin #nav li a { border-bottom: dotted 1px maroon; }
/* scss */
#nav {
li a {
color: maroon;
&:hover {
color: purple;
}
}
}
/* output */
#nav li a { color: maroon; }
#nav li a:hover { color: purple; }
/* scss */
@mixin quicksandlight() {
visibility: hidden;
.wf-active &, .msie.wf-loading &, .msie.wf-inactive & {
visibility:visible;
font-family: 'QuicksandLight', Arial, sans-serif;
}
}
#sample span { @include quicksandlight; }
/* output */
#sample span { visibility: hidden; }
.wf-active #sample span,
.msie.wf-loading #sample span,
.msie.wf-inactive #sample span {
visibility: visible;
font-family: 'QuicksandLight', Arial, sans-serif;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment