~ubuntu-branches/ubuntu/wily/phabricator/wily

« back to all changes in this revision

Viewing changes to src/lint/linter/__tests__/lessc/detached-rulesets.lint-test

  • Committer: Package Import Robot
  • Author(s): Richard Sellam
  • Date: 2014-11-01 23:20:06 UTC
  • mto: This revision was merged to the branch mainline in revision 4.
  • Revision ID: package-import@ubuntu.com-20141101232006-mvlnp0cil67tsboe
Tags: upstream-0~git20141101/arcanist
Import upstream version 0~git20141101, component arcanist

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
@ruleset: {
 
2
     color: black;
 
3
     background: white;
 
4
  };
 
5
 
 
6
@a: 1px;
 
7
.wrap-mixin(@ruleset) {
 
8
  @a: hidden and if you see this in the output its a bug;
 
9
  @b: visible;
 
10
  @d: magic-frame; // same behaviour as mixin calls - falls back to this frame
 
11
  .wrap-selector {
 
12
      @c: visible;
 
13
      @ruleset();
 
14
      visible-one: @b;
 
15
      visible-two: @c;
 
16
    }
 
17
};
 
18
 
 
19
.wrap-mixin({
 
20
  color: black;
 
21
  one: @a;
 
22
  @b: hidden and if you see this in the output its a bug;
 
23
  @c: hidden and if you see this in the output its a bug;
 
24
  four: @d;
 
25
});
 
26
 
 
27
.wrap-mixin(@ruleset: {
 
28
  color: red;
 
29
});
 
30
 
 
31
.wrap-mixin(@ruleset);
 
32
 
 
33
.desktop-and-old-ie(@rules) {
 
34
  @media screen and (min-width: 1200) { @rules(); }
 
35
  html.lt-ie9 &                       { @rules(); }
 
36
}
 
37
 
 
38
header {
 
39
  background: blue;
 
40
 
 
41
  .desktop-and-old-ie({
 
42
    background: red;
 
43
  });
 
44
}
 
45
 
 
46
.wrap-mixin-calls-wrap(@ruleset) {
 
47
  .wrap-mixin(@ruleset);
 
48
};
 
49
 
 
50
.wrap-mixin({
 
51
  test: extra-wrap;
 
52
  .wrap-mixin-calls-wrap({
 
53
    test: wrapped-twice;
 
54
  });
 
55
});
 
56
 
 
57
.wrap-mixin({
 
58
  test-func: unit(90px);
 
59
  test-arithmetic: unit((9+9), px);
 
60
});
 
61
// without mixins
 
62
@ruleset-2: {
 
63
  b: 1;
 
64
};
 
65
.without-mixins {
 
66
  @ruleset-2();
 
67
}
 
68
@my-ruleset: {
 
69
    .my-selector {
 
70
      @media tv {
 
71
        background-color: black;
 
72
      }
 
73
    }
 
74
  };
 
75
@media (orientation:portrait) {
 
76
    @my-ruleset();
 
77
    .wrap-media-mixin({
 
78
      @media tv {
 
79
        .triple-wrapped-mq {
 
80
          triple: true;
 
81
        }
 
82
      }
 
83
    });
 
84
}
 
85
.wrap-media-mixin(@ruleset) {
 
86
  @media widescreen {
 
87
    @media print {
 
88
      @ruleset();
 
89
    }
 
90
    @ruleset();
 
91
  }
 
92
  @ruleset();
 
93
}
 
94
// unlocking mixins
 
95
@my-mixins: {
 
96
  .mixin() {
 
97
    test: test;
 
98
  }
 
99
};
 
100
@my-mixins();
 
101
.a {
 
102
  .mixin();
 
103
}
 
104
~~~~~~~~~~