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

_is-undefined() not working #36

Open
K3TH3R opened this issue Aug 14, 2017 · 3 comments
Open

_is-undefined() not working #36

K3TH3R opened this issue Aug 14, 2017 · 3 comments

Comments

@K3TH3R
Copy link

K3TH3R commented Aug 14, 2017

I'm not sure if this is something that broke in a recent version of SASS, or I'm just using it wrong, but I have been running into a problem using _is-undefined(). There wasn't an example in the docs, so I was trying multiple options, but it just doesn't seem to be working properly either way:

// $zcfg doesn't exist yet
@warn 'is $zcfg undefined? ' _is-undefined(zcfg); // false, should be true?
@warn 'is $zcfg undefined? ' _is-undefined('zcfg'); // false, should be true?
@warn 'is $zcfg undefined? ' _is-undefined('$zcfg'); // false, should be true?
@warn 'is $zcfg undefined? ' _is-undefined($zcfg); // SASS exits with: Error: Undefined variable: "$zcfg".
@warn '$zcfg exists: ' variable-exists(zcfg); // false

$zcfg: 'test';
@warn 'is $zcfg undefined? ' _is-undefined(zcfg); // false
@warn 'is $zcfg undefined? ' _is-undefined('zcfg'); // false
@warn 'is $zcfg undefined? ' _is-undefined('$zcfg'); // false
@warn '$zcfg exists: ' variable-exists(zcfg); // true

This is using [email protected] -> [email protected] -> [email protected]

@davidkpiano
Copy link
Owner

This is the only one that should "return" true:

@warn 'is $zcfg undefined? ' _is-undefined($zcfg); // SASS exits with: Error: Undefined variable: "$zcfg".

since the others are values, and therefore defined.

@K3TH3R
Copy link
Author

K3TH3R commented Aug 14, 2017

That's what my initial expectation was, but the SASS compiler refuses to let me use that syntax.

@davidkpiano
Copy link
Owner

I would default to using variable-exists.

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

No branches or pull requests

2 participants