Skip to content

mixin Variable get scoped away from function variable #365

@designerno1

Description

@designerno1

worked out this test case

@function test-function() {
  $str: 'test-function';
  @return $str;
}

@mixin test-mixin {
  $str: 'test-mixin';
  display: $str;
  $new-bp: test-function();
  display: $str;
}

$str: 'global';
.test{
  display: $str;
  @include test-mixin;
  display: $str;
}

scss compiler output

.test {
  display: "global";
  display: "test-mixin";
  display: "test-mixin";
  display: "global";
}

scssphp output

.test {
  display: 'global';
  display: 'test-mixin';
  display: 'test-function';
  display: 'global';
}

seems the $str from the function overrides the $str from the mixin

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions