$_sugar-component-name: null;
/**
 * Set the name of the component that will be handled inside the mixin
 *
 * @param 			{String} 			[$name=null] 			The name of the component to set
 * @param 			{String|Map} 		[$context=null] 		A context name or map to use inside the mixin
 *
 * @example
 * \@include s-component('my-component') {
 * 		s-component('hello') // => 'my-component'
 * 		\@include s-component('another-component') {
 * 			s-component('hello') // => 'my-component'
 * 		}
 * }
 *
 * @author 			Olivier Bossel <olivier.bossel@gmail.com> (https://olivierbossel.com);
 */
@mixin s-component($name: null, $context: null) {
  $is-root: true;
  @if $_sugar-component-name {
    $is-root: false;
  } @else if $name {
    $_sugar-component-name: $name !global;
  }

  @if $context {
    @include s-context($context) {
      @content;
    }
  } @else {
    @content;
  }

  @if $is-root {
    $_sugar-component-name: null !global;
  }
}
