/**
 * Requires
 */
@use "sass:meta";

/**
 * Select current scope only if given attribute is not set or optionally empty
 * @param {string} $attribute - Attribute name
 * @param {boolean} $empty - Include empty attribute
 * @param {string} $error - Error message prefix
 * @output Wraps given content styles to apply only if the current scope element does not have the given attribute or its empty
 */
@mixin attr-none($attribute: 'class', $empty: true, $error: 'attr-none::') {
  @if meta.content-exists() != true {
    @error '#{$error}@content is required';
  }
  @if $empty {
    &[#{$attribute}=""],
    &:not([#{$attribute}]) {
      @content;
    }
  } @else {
    &:not([#{$attribute}]) {
      @content;
    }
  }
}
