/**
 * Take a transition as parameter and parse it to return the {List} corresponding
 * The $transitions parameter can be either a registered transition name or a custom css transition like : all .2s ease-in-out 2s
 * The $transitions argument will be parsed with the [./_s-parse-properties.scss] function.
 *
 * @param 			{List} 				$transitions 			The registered transition(s) name(s) or the transition(s) strings(s) to transform into list
 * @return 			{List} 										The corresponding transition list properties
 *
 * @example
 * // register a transition
 * \@include s-setup((
 * 		transitions : (
 * 			fast : all .2s ease-in-out 0s,
 * 			// other transitions...
 * 		)
 * ));
 *
 * // registered transition
 * .my-cool-element {
 * 		transition : s-transition(fast);
 * 		// transition : all .2s ease-in-out 0s;
 * }
 *
 * // custom transition
 * .my-cool-element {
 *  	transition : s-transition(fast -delay .5s, fast width ease-in);
 *  	// transition : all .2s ease-in-out .5s, width .2s ease-in 0s;
 * }
 *
 * @author 			Olivier Bossel <olivier.bossel@gmail.com> (https://olivierbossel.com)
 */
@function s-transition($transitions...) {
  $trans: ();
  $available-transitions: map-keys(s-setting("transitions"));
  @if length($transitions) == 0 {
    $trans: s-setting("transitions.default");
  } @else {
    $transitions-settings: s-setting("transitions");
    @each $transition in $transitions {
      // get the transition map
      $t-map: s-transition-map($transition);
      // add the transition into list
      $trans: append(
        $trans,
        map-get($t-map, property)
          map-get($t-map, duration)
          map-get($t-map, ease)
          map-get($t-map, delay),
        comma
      );
    }
  }
  // return the transitions
  @return $trans;
}
