// For using icons as background images (data-uri)
@mixin euiIconBackground($type, $color: $euiColorEmptyShade) {
  // sass-lint:disable-block quotes
  @if variable-exists(type) == false {
    @error 'A $type:string must be provided to @mixin euiIconBackground().';
  } @else if type-of($color) != color {
    @warn "The second parameter must be a valid color type -- got $color:#{type-of($color)} = #{$color}.";
  } @else if $type == 'check' {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='8' viewBox='0 0 10 8'%3E%3Cpath d='M.375 2.625L3.375 5.625M3.375 5.625L8.625.375' fill='none' fill-rule='evenodd' stroke='#{hexToRGB($color)}' stroke-linecap='round' stroke-width='1.5' transform='translate(.5 1)'/%3E%3C/svg%3E");
  } @else if $type == 'dot' {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='6' height='6' viewBox='0 0 6 6'%3E%3Ccircle cx='8' cy='11' r='3' fill='#{hexToRGB($color)}' fill-rule='evenodd' transform='translate(-5 -8)'/%3E%3C/svg%3E");
  } @else if $type == 'square' {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='6' height='6' viewBox='0 0 6 6'%3E%3Crect width='6' height='6' fill='#{hexToRGB($color)}' fill-rule='evenodd'/%3E%3C/svg%3E");
  } @else {
    @error "The $type of #{$type} cannot be found.";
  }
}
