nex3/sass — Issue #292: [Feature Request] Consider adding a @var keyword for local variables
Author: Cosmius
Created: 2012-02-27 01:25:33+00:00
State: open

Adding such a keyword like javascript will make assignment more secure.

```scss
$bar: BarSetInGlobal;
@debug $bar;
@mixin FooMixin($foo) {
@debug $bar;
@var $bar: BarSetInFooMixin;
@debug $bar;
}
@debug $bar;
@include FooMixin(123);
@debug $bar;
```

The code above is expected to print debug messages like:

BarSetInGlobal
BarSetInGlobal
BarSetInGlobal
BarSetInFooMixin
BarSetInGlobal

```scss
$bar: BarSetInGlobal;
@debug $bar;
@mixin FooMixin($foo) {
@debug $bar;
$bar: BarSetInFooMixin;
@debug $bar;
}
@debug $bar;
@include FooMixin(123);
@debug $bar;
```

The code above prints debug messages like:

BarSetInGlobal
BarSetInGlobal
BarSetInGlobal
BarSetInFooMixin
BarSetInFooMixin