13 - "@for @each @while @if @else"
15 - "$map: (a: b, c: d)"
49 align: center; // like text-align: center
50 transform: uppercase; // like text-transform: uppercase
65 font-family: sans-serif;
72 @include heading-font;
79 @mixin font-size($n) {
80 font-size: $n * 1.2em;
86 @include font-size(2);
90 #### with default values
93 @mixin pad($n: 10px) {
104 #### with a default variable
107 // Set a default value
108 $default-padding: 10px;
112 @mixin pad($n: $default-padding) {
140 @import './other_sass_file';
143 The `.scss` or `.sass` extension is optional.
151 rgba(100, 120, 140, .5)
158 mix($a, $b, 10%) // 10% a, 90% b
170 desaturate($color, 5%)
175 adjust-hue($color, 15deg)
176 complement($color) // like adjust-hue(_, 180deg)
181 fade-in($color, .5) // aka opacify()
182 fade-out($color, .5) // aka transparentize() - halves the opacity
183 rgba($color, .5) // sets alpha to .5
186 ### Getting individual values
191 hue($color) // → 0deg..360deg
192 saturation($color) // → 0%..100%
193 lightness($color) // → 0%..100%
194 alpha($color) // → 0..1 (aka opacity())
200 red($color) // → 0..255
205 See: [hue()](http://sass-lang.com/documentation/Sass/Script/Functions.html#hue-instance_method), [red()](http://sass-lang.com/documentation/Sass/Script/Functions.html#red-instance_method)
210 // Changes by fixed amounts
211 adjust-color($color, $blue: 5)
212 adjust-color($color, $lightness: -30%) // like darken(_, 30%)
213 adjust-color($color, $alpha: -0.4) // like fade-out(_, .4)
214 adjust-color($color, $hue: 30deg) // like adjust-hue(_, 15deg)
218 // Changes via percentage
219 scale-color($color, $lightness: 50%)
223 // Changes one property completely
224 change-color($color, $hue: 180deg)
225 change-color($color, $blue: 250)
228 Supported: `$red` `$green` `$blue` `$hue` `$saturation` `$lightness` `$alpha`
245 str-length(hello world)
246 str-slice(hello, 2, 5) // "ello" - it's 1-based, not 0-based
247 str-insert("abcd", "X", 1) // "Xabcd"
254 unitless(100px) // false
272 percentage(.5) // 50%
279 variable-exists(red) // checks for $red
280 mixin-exists(red-text) // checks for @mixin red-text
281 function-exists(redify)
285 global-variable-exists(red)
289 selector-append('.menu', 'li', 'a') // .menu li a
290 selector-nest('.menu', '&:hover li') // .menu:hover li
293 selector-replace(...)
302 feature-exists(global-variable-shadowing)
307 * global-variable-shadowing
308 * extend-selector-pseudoclass
317 @for $i from 1 through 4 {
318 .item-#{$i} { left: 20px * $i; }
322 ### Each loops (simple)
325 $menu-items: home about services contact;
327 @each $item in $menu-items {
329 background: url('images/#{$item}.jpg');
334 ### Each loops (nested)
336 $backgrounds: (home, 'home.jpg'), (about, 'about.jpg');
338 @each $id, $image in $backgrounds {
340 background: url($image);
350 .item-#{$i} { width: 2em * $i; }
360 @if $position == 'left' {
364 @else if $position == 'right' {
376 .#{$klass} { ... } // Class
377 call($function-name) // Functions
380 font: #{$size}/#{$line-height}
381 url("#{$background}.jpg")
389 nth($list, 1) // starts with 1
392 @each $item in $list { ... }
398 $map: (key1: value1, key2: value2, key3: value3);
406 - <http://sass-lang.com/documentation/Sass/Script/Functions.html>
407 - <http://sass-lang.com/documentation/file.SASS_REFERENCE.html#sassscript>