Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

string assigned to function is interpreted as colour #1525

Closed
nirazul opened this issue Sep 3, 2015 · 1 comment
Closed

string assigned to function is interpreted as colour #1525

nirazul opened this issue Sep 3, 2015 · 1 comment

Comments

@nirazul
Copy link

nirazul commented Sep 3, 2015

I have the following color-function:

@function getColor($idx) {
    $color: pink;

    @if type-of($idx) == 'string' {
        $color: map-get($labels, $idx);
    }

    @return $color;
}

$labels: (
    'selection': rgba(0,0,0, 0.15),
    'blue': #0071b0,
    'red': #dc0c42,
    'background': #727d8e,
    'lines': #D2D2D7
);

When I upgraded to latest node-sass version, the function suddenly stopped working for the values blue and red because type-of($idx) returns 'color' for them:

background-color: getColor('label', 'blue');

Versions:
node-sass: 3.3.2, which means libsass: 3.2.5

A related issue is: #652
...but it's marked resolved.

@xzyfer
Copy link
Contributor

xzyfer commented Sep 3, 2015

This is fixed on master and will be the next version of LibSass.

@xzyfer xzyfer closed this as completed Sep 3, 2015
saper added a commit to saper/sass-spec that referenced this issue Sep 24, 2015
saper added a commit to saper/sass-spec that referenced this issue Sep 24, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants