@use 'sass:list';

// True Message
// ------------
/// Output a message to CSS comments,
/// or command line terminal (via debug/warn)
/// @access private
/// @group private-message
/// @param {String} $message -
///   Message to output
/// @param {String} $output [comments] -
///   Type of output, either `comments`, `terminal`, `debug` or `warn`
@mixin message($message, $output: 'comments', $comment-padding: 0) {
  $pad: '';

  @if ($comment-padding > 0) {
    @for $i from 0 to $comment-padding {
      $pad: $pad + ' ';
    }
  }

  @each $line in $message {
    @if list.index($output, 'comments') {
      // sass-lint:disable-line no-empty-rulesets

      /* #{$pad + $line} */ // sass-lint:disable-line no-css-comments
    }

    @if list.index($output, 'debug') or list.index($output, 'terminal') {
      @debug $line; // sass-lint:disable-line no-debug
    }

    @if list.index($output, 'warn') {
      @warn $line;
    }
  }
}
