Skip to content

Instantly share code, notes, and snippets.

@4aficiona2
Created June 20, 2014 20:36
Show Gist options
  • Save 4aficiona2/82343ba297fdde1b3e39 to your computer and use it in GitHub Desktop.
Save 4aficiona2/82343ba297fdde1b3e39 to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
<div class="positiveOrNegative">positiveOrNegative: </div>
// ----
// Sass (v3.3.8)
// Compass (v1.0.0.alpha.19)
// ----
@function positiveOrNegative() {
// can be 0 or -1
$randNumber : (1 - random(2));
// return 1 if is 0, otherwise return -1
@return if($randNumber == 0, 1, $randNumber);
}
.positiveOrNegative {
&:after {
content: "#{positiveOrNegative()}";
}
}
.positiveOrNegative:after {
content: "-1";
}
<div class="positiveOrNegative">positiveOrNegative: </div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment