$_s-unit-context: null;
/**
 * Set the unit context to use inside the mixin.
 * This mean that if you set a unit context, then get a number setting through the [s-setting function](../functions/_s-setting.scss),
 * The value that will be returned will be converted into the unit context if possible
 *
 * @param 			{String} 			$unit 			The unit wanted
 *
 * @example
 * // if settings.typography.font-size == 16px
 * s-setting('typography.font-size'); // => 16px
 * \@incluse s-unit-context(rem) {
 * 		s-setting('typography.font-size'); // => 1rem
 * }
 *
 * @author 			Olivier Bossel <olivier.bossel@gmail.com> (https://olivierbossel.com)
 */
@mixin s-unit-context($unit) {
  // check params
  @if $_sugar-test-arguments {
    $unit: s-test-argument(
      "s-unit-context",
      "unit",
      (px, rem, em, percent, "%", pt),
      $unit
    );
  }
  // save the previous unit context to restore it after
  $previous-unit-context: $_s-unit-context;
  // set the new unit context
  $_s-unit-context: $unit !global;
  // execute the content
  @content;
  // restore the unit context to previous unit context
  $_s-unit-context: $previous-unit-context !global;
}
