0
|
1 @charset "UTF-8";
|
|
2
|
|
3 /// Converts shorthand to the 4-value syntax.
|
|
4 ///
|
|
5 /// @argument {list} $shorthand
|
|
6 ///
|
|
7 /// @example scss
|
|
8 /// .element {
|
|
9 /// margin: _unpack(1em 2em);
|
|
10 /// }
|
|
11 ///
|
|
12 /// // CSS Output
|
|
13 /// .element {
|
|
14 /// margin: 1em 2em 1em 2em;
|
|
15 /// }
|
|
16 ///
|
|
17 /// @access private
|
|
18
|
|
19 @function _unpack($shorthand) {
|
|
20 @if length($shorthand) == 1 {
|
|
21 @return nth($shorthand, 1) nth($shorthand, 1) nth($shorthand, 1) nth($shorthand, 1);
|
|
22 } @else if length($shorthand) == 2 {
|
|
23 @return nth($shorthand, 1) nth($shorthand, 2) nth($shorthand, 1) nth($shorthand, 2);
|
|
24 } @else if length($shorthand) == 3 {
|
|
25 @return nth($shorthand, 1) nth($shorthand, 2) nth($shorthand, 3) nth($shorthand, 2);
|
|
26 } @else {
|
|
27 @return $shorthand;
|
|
28 }
|
|
29 }
|