diff options
| -rw-r--r-- | src/_functions.scss | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/_functions.scss b/src/_functions.scss index 236b548..9dd14b1 100644 --- a/src/_functions.scss +++ b/src/_functions.scss | |||
| @@ -98,6 +98,25 @@ | |||
| 98 | } | 98 | } |
| 99 | 99 | ||
| 100 | /// | 100 | /// |
| 101 | /// Reverse the order of items in a list. | ||
| 102 | /// | ||
| 103 | /// @param {list} $list | ||
| 104 | /// | ||
| 105 | /// @return {list} Teh reversed list | ||
| 106 | /// | ||
| 107 | @function list-reverse($list) { | ||
| 108 | @if length($list) == 0 { | ||
| 109 | @return $list; | ||
| 110 | } | ||
| 111 | |||
| 112 | $result: (); | ||
| 113 | @for $i from length($list) * -1 through -1 { | ||
| 114 | $result: append($result, nth($list, abs($i))); | ||
| 115 | } | ||
| 116 | @return $result; | ||
| 117 | } | ||
| 118 | |||
| 119 | /// | ||
| 101 | /// Sort numeric items in a list. | 120 | /// Sort numeric items in a list. |
| 102 | /// | 121 | /// |
| 103 | /// The implementation is based on the algorithm on the German Wikipedia article | 122 | /// The implementation is based on the algorithm on the German Wikipedia article |
