added rss feed in footer
[theme-danix.xyz.git] / assets / sass / bourbon / bourbon / utilities / _compact-shorthand.scss
1 @charset "UTF-8";
2
3 /// Transforms shorthand to its shortest possible form.
4 ///
5 /// @argument {list} $values
6 /// List of directional values.
7 ///
8 /// @example scss
9 /// $values: _compact-shorthand(10px 20px 10px 20px);
10 ///
11 /// // Output
12 /// $values: 10px 20px;
13 ///
14 /// @return {list}
15 ///
16 /// @access private
17
18 @function _compact-shorthand($values) {
19 $output: null;
20
21 $a: nth($values, 1);
22 $b: if(length($values) < 2, $a, nth($values, 2));
23 $c: if(length($values) < 3, $a, nth($values, 3));
24 $d: if(length($values) < 2, $a, nth($values, if(length($values) < 4, 2, 4)));
25
26 @if $a == 0 { $a: 0; }
27 @if $b == 0 { $b: 0; }
28 @if $c == 0 { $c: 0; }
29 @if $d == 0 { $d: 0; }
30
31 @if $a == $b and $a == $c and $a == $d {
32 $output: $a;
33 } @else if $a == $c and $b == $d {
34 $output: $a $b;
35 } @else if $b == $d {
36 $output: $a $b $c;
37 } @else {
38 $output: $a $b $c $d;
39 }
40
41 @return $output;
42 }