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

Getting color throws an error if no grade is specified #53

Open
diego-codes opened this issue Feb 3, 2017 · 1 comment · May be fixed by #58
Open

Getting color throws an error if no grade is specified #53

diego-codes opened this issue Feb 3, 2017 · 1 comment · May be fixed by #58

Comments

@diego-codes
Copy link
Contributor

diego-codes commented Feb 3, 2017

The documentation states that we can retrieve a core color by not supplying a grade like this:

.foo {
  color: color('blue');
}

However, I get this error on all colors except for white:

Message:
    node_modules/ibm-design-colors/_ibm-colors.scss
Error: argument `$color` of `rgba($color, $alpha)` must be a color

       Backtrace:
       	node_modules/ibm-design-colors/_ibm-colors.scss:52, in function `rgba`
       	node_modules/ibm-design-colors/_ibm-colors.scss:52, in function `color`
       	dashboard/src/styles/scss/_modal.scss:8
        on line 52 of node_modules/ibm-design-colors/_ibm-colors.scss
>>     @return rgba($grd, $alpha);
   ------------^
@diego-codes
Copy link
Contributor Author

diego-codes commented Feb 3, 2017

By the way, it was hard to figure out what the bug was. I had to go into the source code of the .scss file and had to check what $grd value was throwing an error. To figure out where I was using the color function in a way that would throw an error, I had to add:

@if type-of($grd) != color {
  @debug &;
 }

An error to help trace back the problem would have been really helpful in this scenario.

This was referenced Feb 22, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant