User Tools

Site Tools


sasset:conditional_if_statements_and_argument_lists
no way to compare when less than two revisions

Differences

This shows you the differences between two versions of the page.


sasset:conditional_if_statements_and_argument_lists [2016/04/02 14:34] (current) – created leo
Line 1: Line 1:
 +|<- [[Using the @content container]]|[[Looping through lists with @for]] ->|
  
 +Créer une mixin qui prend un nombre non déterminé de valeur :
 +
 +<code>
 +@mixin break($args...) { // on ajoute trois point à n'importe quelle variable, cela signifie qu'il s'agira d'une série de valeurs
 +// @mixin break($first, $args...) { // first valeur habituelle, $args série de n valeur
 +  @if length($args) == 1 {
 +    @media (min-width: nth($args, 1) {
 +      @content;
 +    }
 +  } @else {
 +    @media (min-width: nth($args, 1) and (max-width: nth($args, 2) {
 +      @content;
 +    }
 +  }
 +  @media (min-width: nth($args, 1)) { //le premier argument passé
 +    @content;
 +  }
 +}
 +</code>
 +
 +<code>
 +footer {
 +  @include break(0, 500px) {
 +    display: none;
 +  }
 +}
 +</code>
 +
 +(il ne semble pas y avoir de else if)
sasset/conditional_if_statements_and_argument_lists.txt · Last modified: 2016/04/02 14:34 by leo