summaryrefslogtreecommitdiff
path: root/scss/tests/files/kronuz/scoping-control.scss
blob: 44d11a9749ec45dc0a0ed9665c617e48c342a764 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
@option style:legacy;
@option legacy-scoping:yes;

div {
  $first: red;
  A-red: $first;

  @each $x in magenta orange {
    $first: $x;
  }
  A-orange: $first;

  @if true {
    $first: black;
  }
  B-black: $first;

  @for $i from 1 through 2 {
    $first: blue;
  }
  B-blue: $first;

  @each $y in 1 2 3 {
    @each $x in black white {
      $first: $x;
    }
  }
  B-white: $first;

  // Second round of tests (undefined variables defined within @if, @for or @each):
  // DEVIATION! in Sass, the colors inside the following constructs (since they're undefined) are left undefined at the end of the control blocks:
  @if true {
    $second: olive;
  }
  $second: grey !default;
  C-olive: $second;

  @for $i from 1 through 2 {
    $third: violet;
  }
  $third: snow !default;
  C-violet: $third;

  @each $y in 1 2 3 {
    $fourth: black;
    @each $x in silver gold {
      $fifth: $x;
    }
  }
  $fourth: seashell !default;
  C-black: $fourth;
  $fifth: mintcream !default;
  C-gold: $fifth;
}

a {
  $some: green !default;
  color: $some;
}