Skip to content

Instantly share code, notes, and snippets.

@finteractive
Last active August 29, 2015 14:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save finteractive/369d473388053d2b03bd to your computer and use it in GitHub Desktop.
Save finteractive/369d473388053d2b03bd to your computer and use it in GitHub Desktop.
Control Directives (Generated by SassMeister.com)
// ----
// libsass (v3.2.5)
// ----
/*
Source: http://sass-lang.com/documentation/file.SASS_REFERENCE.html#control_directives__expressions
Source: http://www.sitepoint.com/sass-basics-control-directives-expressions/
Topic: Controll Directives
*/
/* if() */
@mixin test($condition) {
$color: if($condition, blue, red);
color:$color
}
.firstClass {
@include test(true);
}
.secondClass {
@include test(false);
}
/* @if */
// $type: monster;
// p {
// @if $type == ocean {
// color: blue;
// } @else if $type == matador {
// color: red;
// } @else if $type == monster {
// color: green;
// } @else {
// color: black;
// }
// }
/* @for */
// @for $i from 1 through 5 {
// .item-#{$i} { width: 2em * $i; }
// }
/* @for (to) */
// @for $i from 1 to 5 {
// .item-#{$i} { width: 2em * $i; }
// }
/* @each */
// @each $animal in puma, sea-slug, egret, salamander {
// .#{$animal}-icon {
// background-image: url('/images/#{$animal}.png');
// }
// }
/* @while */
// $i: 6;
// @while $i > 0 {
// .item-#{$i} { width: 2em * $i; }
// $i: $i - 2;
// }
/*
Source: http://sass-lang.com/documentation/file.SASS_REFERENCE.html#control_directives__expressions
Source: http://www.sitepoint.com/sass-basics-control-directives-expressions/
Topic: Controll Directives
*/
/* if() */
.firstClass {
color: blue;
}
.secondClass {
color: red;
}
/* @if */
/* @for */
/* @for (to) */
/* @each */
/* @while */
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment