1// Outputs a list of values instead of a single value
2@function ms-list($Start: 0, $End: 0, $Bases: $ms-base, $Ratios: $ms-ratio) {
3
4  // Seed results
5  $Positive-return: ();
6  $Negitive-return: ();
7  $Return: ();
8
9  @if $End >= 0 {
10    // Generate a list of all possible values
11    $Positive-return: ms-generate-list($End, $Bases, $Ratios);
12
13    // Sort the generated lists
14    $Positive-return: ms-sort-list($Positive-return);
15
16    // Trim list
17    $Trim-list: ();
18    // If the starting value is a positive number
19    // trim the positive return from that
20    @if $Start >= 0 {
21      @for $i from ($Start + 1) through $End + 1 {
22        $Trim-list: join($Trim-list, nth($Positive-return, $i));
23      }
24    }
25    // If not, then include everything up to the end.
26    @else {
27      @for $i from 1 through $End + 1 {
28        $Trim-list: join($Trim-list, nth($Positive-return, $i));
29      }
30    }
31    $Positive-return: $Trim-list;
32  }
33
34  // Generate a negitive list
35  @if $Start < 0 {
36    // Generate a list of all possible values
37    $Negitive-return: ms-generate-list($Start, $Bases, $Ratios);
38
39    // Sort the generated lists
40    $Negitive-return: ms-sort-list($Negitive-return);
41
42    // Reverse negitive list results.
43    $MS-new-return: ();
44    @each $i in $Negitive-return {
45      $MS-new-return: join($i, $MS-new-return);
46    }
47    $Negitive-return: $MS-new-return;
48
49    // Trim list
50    $Trim-list: ();
51    @if $End < 0 {
52      @for $i from abs($End) through (abs($Start) + 2) {
53        $Trim-list: join(nth($Negitive-return, $i), $Trim-list);
54      }
55    }
56    @else {
57      @for $i from 2 through (abs($Start) + 1) {
58        $Trim-list: join(nth($Negitive-return, $i), $Trim-list);
59      }
60    }
61    $Negitive-return: $Trim-list;
62  }
63
64  // Join both positive and negitive possibilities.
65  $Return: join($Negitive-return, $Positive-return);
66
67  @return $Return;
68}
69