Skip to content
This repository was archived by the owner on Nov 4, 2022. It is now read-only.
This repository was archived by the owner on Nov 4, 2022. It is now read-only.

Throwed wrong error of undefined #60

@jshengGoku

Description

@jshengGoku

https://github.com/IBM-Design/colors/blob/master/_ibm-colors.scss#L51

@function color($palette, $grade: 0, $alpha: 1) {
  // Because it's spelled gr(a|e)y and we've got spaces
  @if $palette == 'grey' {
    $palette: 'gray';
  }
  @else if $palette == 'warm-grey' or $palette == 'warm grey' or $palette == 'warm gray' {
    $palette: 'warm-gray';
  }
  @else if $palette == 'cool-grey' or $palette == 'cool grey' or $palette == 'cool gray' {
    $palette: 'cool-gray';
  }
  @else if $palette == 'neutral white' {
    $palette: 'neutral-white';
  }
  @else if $palette == 'cool white' {
    $palette: 'cool-white';
  }
  @else if $palette == 'warm white' {
    $palette: 'warm-white';
  }

  $plt: map-get($__ibm-color-palettes, $palette);

  @if $plt {
    $grd: map-get($plt, $grade);
    @return rgba($grd, $alpha);
  }

  $error-message: 'Color palette "#{$palette}" not found';
  @if not $found-index { // broken line
    @if feature-exists(at-error) {
      @error $error-message; //expected line
    }
    @else {
      @warn $error-message;  //expected line
    }
  }

  @return false;
}

It looks like $found-index is undefined in this function, I guess it is accidently copied from _ibm-find-color()

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions