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

Throwed wrong error of undefined #60

Open
jshengGoku opened this issue Apr 26, 2017 · 1 comment
Open

Throwed wrong error of undefined #60

jshengGoku opened this issue Apr 26, 2017 · 1 comment

Comments

@jshengGoku
Copy link

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()

@seejamescode
Copy link
Collaborator

Thanks for the find @smmJasoff, would you be able to submit a PR?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants