~ubuntu-branches/ubuntu/vivid/phabricator/vivid-proposed

« back to all changes in this revision

Viewing changes to arcanist/src/lint/linter/__tests__/lessc/scope.lint-test

  • Committer: Package Import Robot
  • Author(s): Richard Sellam
  • Date: 2014-10-23 20:49:26 UTC
  • mfrom: (0.2.1) (0.1.1)
  • Revision ID: package-import@ubuntu.com-20141023204926-vq80u1op4df44azb
Tags: 0~git20141023-1
Initial release (closes: #703046)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
@x: red;
 
2
@x: blue;
 
3
@z: transparent;
 
4
@mix: none;
 
5
 
 
6
.mixin {
 
7
  @mix: #989;
 
8
}
 
9
@mix: blue;
 
10
.tiny-scope {
 
11
  color: @mix; // #989
 
12
  .mixin;
 
13
}
 
14
 
 
15
.scope1 {
 
16
  @y: orange;
 
17
  @z: black;
 
18
  color: @x; // blue
 
19
  border-color: @z; // black
 
20
  .hidden {
 
21
    @x: #131313;
 
22
  }
 
23
  .scope2 {
 
24
    @y: red;
 
25
    color: @x; // blue
 
26
    .scope3 {
 
27
      @local: white;
 
28
      color: @y; // red
 
29
      border-color: @z; // black
 
30
      background-color: @local; // white
 
31
    }
 
32
  }
 
33
}
 
34
 
 
35
#namespace {
 
36
  .scoped_mixin() {
 
37
    @local-will-be-made-global: green;
 
38
    .scope {
 
39
      scoped-val: @local-will-be-made-global;
 
40
        }
 
41
  }
 
42
}
 
43
 
 
44
#namespace > .scoped_mixin();
 
45
 
 
46
.setHeight(@h) { @height: 1024px; }
 
47
.useHeightInMixinCall(@h) { .useHeightInMixinCall { mixin-height: @h; } }
 
48
@mainHeight: 50%;
 
49
.setHeight(@mainHeight);
 
50
.heightIsSet { height: @height; }
 
51
.useHeightInMixinCall(@height);
 
52
 
 
53
.importRuleset() {
 
54
  .imported {
 
55
    exists: true;
 
56
  }
 
57
}
 
58
.importRuleset();
 
59
.testImported {
 
60
  .imported;
 
61
}
 
62
 
 
63
@parameterDefault: 'top level';
 
64
@anotherVariable: 'top level';
 
65
//mixin uses top-level variables
 
66
.mixinNoParam(@parameter: @parameterDefault) when (@parameter = 'top level') {
 
67
  default: @parameter;
 
68
  scope: @anotherVariable;
 
69
  sub-scope-only: @subScopeOnly;
 
70
}
 
71
 
 
72
#allAreUsedHere {
 
73
  //redefine top-level variables in different scope
 
74
  @parameterDefault: 'inside';
 
75
  @anotherVariable: 'inside';
 
76
  @subScopeOnly: 'inside';
 
77
  //use the mixin
 
78
  .mixinNoParam();
 
79
}
 
80
#parentSelectorScope {
 
81
  @col: white;
 
82
  & {
 
83
    @col: black;
 
84
  }
 
85
  prop: @col;
 
86
  & {
 
87
    @col: black;
 
88
  }
 
89
}
 
90
.test-empty-mixin() {
 
91
}
 
92
#parentSelectorScopeMixins {
 
93
  & {
 
94
    .test-empty-mixin() {
 
95
      should: never seee 1;
 
96
    }
 
97
  }
 
98
  .test-empty-mixin();
 
99
  & {
 
100
    .test-empty-mixin() {
 
101
      should: never seee 2;
 
102
    }
 
103
  }
 
104
}
 
105
~~~~~~~~~~