Skip to content

Instantly share code, notes, and snippets.

@micahgodbolt
Created July 3, 2014 18:31
Show Gist options
  • Save micahgodbolt/aca60fbec553c8cba557 to your computer and use it in GitHub Desktop.
Save micahgodbolt/aca60fbec553c8cba557 to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
// ----
// Sass (v3.3.9)
// Compass (v1.0.0.alpha.20)
// ----
@mixin context($target, $new-context, $selector: null) {
$selector: & !default;
$new-selector: selector-replace($selector, $target, $new-context);
@at-root #{$new-selector} {
@content;
}
}
div {
nav {
a {
color: red;
@include context('nav', 'nav.open') {
color: blue;
}
}
}
}
Invalid CSS after " $selector: ": expected expression (e.g. 1px, bold), was "& !default;"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment