comparison default/assets/scss/vendors/bourbon/utilities/_unpack.scss @ 0:1d038bc9b3d2 default tip

Up:default
author Liny <dev@neowd.com>
date Sat, 31 May 2025 09:21:51 +0800
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:1d038bc9b3d2
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 }