Skip to content

Instantly share code, notes, and snippets.

@adamjohnson
Created June 25, 2015 15:32
Show Gist options
  • Save adamjohnson/ab61a017ee9d167329b3 to your computer and use it in GitHub Desktop.
Save adamjohnson/ab61a017ee9d167329b3 to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
// ----
// libsass (v3.2.5)
// ----
// The variable cascade!
// NOTE: This example is meant to illustrate how variables cascade.
// NOTE: this may seem elementary, but imagine trying to override these variables in different files in different parts of the cascade.
// Example 1: Outputs white because $first-variable: 'blue'; comes after the .outputs-white class
$first-variable: 'white';
.outputs-white { color: $first-variable; } // Will output white, not blue
$first-variable: 'blue';
// Example 2: Outputs blue because $second-variable: 'blue'; comes *before* the .outputs-blue class
$second-variable: 'white';
$second-variable: 'blue';
.outputs-blue { color: $second-variable; } // Will output blue
.outputs-white {
color: "white";
}
.outputs-blue {
color: "blue";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment