Skip to content

Instantly share code, notes, and snippets.

@roryashfordbentley
Created November 13, 2014 09:33
Show Gist options
  • Save roryashfordbentley/629423a78be99a2c5bca to your computer and use it in GitHub Desktop.
Save roryashfordbentley/629423a78be99a2c5bca to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
// ----
// Sass (v3.4.7)
// Compass (v1.0.1)
// ----
// Sass variables scope example
$test: true;
$name: ".beefy";
@mixin scopetest(){
//$name: null // this would reinstantiate the variable within the scope of the mixin so the below values are used.
@if($test == true){
$name: ".foo";
} @else {
$name: ".bar";
}
.test{
rule: $name;
}
}
@include scopetest();
.test {
rule: ".beefy";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment