Last active
August 29, 2015 14:28
-
-
Save finteractive/369d473388053d2b03bd to your computer and use it in GitHub Desktop.
Control Directives (Generated by SassMeister.com)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ---- | |
// 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; | |
// } | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
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