dart-sass icon indicating copy to clipboard operation
dart-sass copied to clipboard

global-variable-exists returning false for varialbes imported via @use

Open pete-hotchkiss opened this issue 3 years ago • 2 comments

This may well be intended behavior - but I'm puzzled as to why a variable imported into a wild card name space returns false for global-variable-exists checks

a.scss

$foo: 24px;
@use "a" as *;
@debug meta.global-variable-exists("foo"); // false

should it not return true ?

If I switch out the @use for the legacy @import it returns true.

Am I implementing this incorrectly perhaps ?

pete-hotchkiss avatar Mar 20 '21 00:03 pete-hotchkiss

global-variable-exists does return true for @useed vars. It's hard to say why this is returning false without more context.

Awjin avatar Mar 22 '21 16:03 Awjin

@pete-hotchkiss when I try your code snippet (adding the missing @use 'sass:meta'; to make it working), the @debug shows true, not false. which version of dart-sass are you using, and are you indeed reproducing the issue with the code snippet you shared ?

stof avatar Apr 08 '21 08:04 stof