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 : | ||
+ | |||
+ | < | ||
+ | @mixin break($args...) { // on ajoute trois point à n' | ||
+ | // @mixin break($first, | ||
+ | @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; | ||
+ | } | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | < | ||
+ | footer { | ||
+ | @include break(0, 500px) { | ||
+ | display: none; | ||
+ | } | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | (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