| 1 |
@mixin size($size) { |
| 2 |
@if length($size) == 1 { |
| 3 |
@if $size == auto { |
| 4 |
width: $size; |
| 5 |
height: $size; |
| 6 |
} |
| 7 |
|
| 8 |
@else if unitless($size) { |
| 9 |
width: $size + px; |
| 10 |
height: $size + px; |
| 11 |
} |
| 12 |
|
| 13 |
@else if not(unitless($size)) { |
| 14 |
width: $size; |
| 15 |
height: $size; |
| 16 |
} |
| 17 |
} |
| 18 |
|
| 19 |
// Width x Height |
| 20 |
@if length($size) == 2 { |
| 21 |
$width: nth($size, 1); |
| 22 |
$height: nth($size, 2); |
| 23 |
|
| 24 |
@if $width == auto { |
| 25 |
width: $width; |
| 26 |
} |
| 27 |
@else if not(unitless($width)) { |
| 28 |
width: $width; |
| 29 |
} |
| 30 |
@else if unitless($width) { |
| 31 |
width: $width + px; |
| 32 |
} |
| 33 |
|
| 34 |
@if $height == auto { |
| 35 |
height: $height; |
| 36 |
} |
| 37 |
@else if not(unitless($height)) { |
| 38 |
height: $height; |
| 39 |
} |
| 40 |
@else if unitless($height) { |
| 41 |
height: $height + px; |
| 42 |
} |
| 43 |
} |
| 44 |
} |