Blame view

node_modules/less/test/less-bom/extend-chaining.less 1.29 KB
ce4c83ff   wxy   初始提交
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
  //very simple chaining
  .a {
    color: black;
  }
  .b:extend(.a) {}
  .c:extend(.b) {}
  
  //very simple chaining, ordering not important
  
  .d:extend(.e) {}
  .e:extend(.f) {}
  .f {
    color: black;
  }
  
  //extend with all
  
  .g.h {
    color: black;
  }
  .i.j:extend(.g all) {
    color: white;
  }
  .k:extend(.i all) {}
  
  //extend multi-chaining
  
  .l {
    color: black;
  }
  .m:extend(.l){}
  .n:extend(.m){}
  .o:extend(.n){}
  .p:extend(.o){}
  .q:extend(.p){}
  .r:extend(.q){}
  .s:extend(.r){}
  .t:extend(.s){}
  
  // self referencing is ignored
  
  .u {color: black;}
  .v.u.v:extend(.u all){}
  
  // circular reference because the new extend product will match the existing extend
  
  .w:extend(.w) {color: black;}
  .v.w.v:extend(.w all){}
  
  // classic circular references
  
  .x:extend(.z) {
    color: x;
  }
  .y:extend(.x) {
    color: y;
  }
  .z:extend(.y) {
    color: z;
  }
  
  //very simple chaining, but with the extend inside the ruleset
  .va {
    color: black;
  }
  .vb {
    &:extend(.va);
    color: white;
  }
  .vc {
    &:extend(.vb);
  }
  
  // media queries - don't extend outside, do extend inside
  
  @media tv {
    .ma:extend(.a,.b,.c,.d,.e,.f,.g,.h,.i,.j,.k,.l,.m,.n,.o,.p,.q,.r,.s,.t,.u,.v,.w,.x,.y,.z,.md) {
      color: black;
    }
    .md {
      color: white;
    }
    @media plasma {
      .me, .mf {
        &:extend(.mb,.md);
        background: red;
      }
    }
  }
  .mb:extend(.ma) {};
  .mc:extend(.mb) {};