6. A cleaner, more organized working codebase
Quicker updates and creation of styles
Optimized and more efficient compiled CSS
Save time from bottlenecks
(ie: vendor-prefixes)
28. @mixin general-styles($theView) {
#header-main {
Under One…Maybe Two Conditions
@if $theView == full or $theView == mid or $theView == tablet {
padding: 3px 0;
height: element-size(100);
} @else if $theView == smart {
height: element-size(50);
} @else {
height: element-size(170);
}
}
}
@include general-styles(full);
29. Under One…Maybe Two Conditions
@media only screen and (max-width: 25.875em) {
@include universal-styles(dumb);
@include global-styles(dumb);
}
@media only screen and (min-width: 25.9375em) and (max-width: 39.3125em) {
@include universal-styles(smart);
@include global-styles(smart);
}
@media only screen and (min-width: 39.375em) and (max-width: 54.625em) {
@include universal-styles(tablet);
@include global-styles(tablet);
}
@media only screen and (min-width: 54.6875em) and (max-width: 64.9375em) {
@include universal-styles(mid);
@include global-styles(mid);
}
@media only screen and (min-width: 65em) {
@include universal-styles(full);
@include global-styles(full);
}
31. @for
-@for $var from <start> through <end> // Includes a loop for the <end> value
- @for $var from <start> to <end> // Stops looping when <end> is reached
@each
- @each $var in <list>
@while
-@while <condition is true> (ie: $i < 10)
Getting Straight with Loops
Basic Syntax