Table of Contents

Using the exercise filesAnalyzing installation options

What is SASS

Features

Syntaxe

SASS

.classe
  ul
    margin: 0
    li
      float: left

SCSS

.classe {
  ul {
    margin: 0
    li {
      float: left
    }
  }
}

Exemples

Variables

$rouge : #ff000;
$bleu : #0000ff;

nesting

.classe {
  //styles
  ul {
    // styles
    li {
      //styles
    }
  }
}

Partials

@import "mixins";

Extend

.mon_style { color: $red; }
.mon_style_etendu {
  @extend .mon_style;
  background: $bleu;
}

Opérateurs

$bordure: 1px;
$bordure_epaisse: $bordure * 5;

.sidebar {
  @if ($bordure<=1) {
    background: $rouge;
  } @else {
    background: $bleu;
  }
}

Mixins

@mixin rounded($radius: 10px) {

border-radius: $radius;

} ul {

li img {
  @include rounded(20px);
}

}