extend.less 1015 Bytes
Newer Older
liang ce committed
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
.error {
  border: 1px #f00;
  background: #fdd;
}
.error.intrusion {
  font-size: 1.3em;
  font-weight: bold;
}
.intrusion .error {
  display: none;
}
.badError {
  &:extend(.error all);
  border-width: 3px;
}

.foo .bar, .foo .baz {
    display: none;
}

.ext1 .ext2 {
    &:extend(.foo all);
}

.ext3,
.ext4 {
  &:extend(.foo all);
  &:extend(.bar all);
}

div.ext5,
.ext6 > .ext5 {
    width: 100px;
}

.ext7 {
    &:extend(.ext5 all);
}

.ext8.ext9 {
  result: add-foo;
}
.ext8 .ext9,
.ext8 + .ext9,
.ext8 > .ext9 {
  result: bar-matched;
}
.ext8.nomatch {
  result: none;
}
.ext8 {
  .ext9 {
    result: match-nested-bar;
  }
}
.ext8 {
  &.ext9 {
    result: match-nested-foo;
  }
}

.fuu:extend(.ext8.ext9 all) {}
.buu:extend(.ext8 .ext9 all) {}
.zap:extend(.ext8 + .ext9 all) {}
.zoo:extend(.ext8 > .ext9 all) {}

.aa {
  color: black;
  .dd {
    background: red;
  }
}
.bb {
  background: red;
  .bb {
    color: black;
  }
}
.cc:extend(.aa,.bb) {}
.ee:extend(.dd all,.bb) {}
.ff:extend(.dd,.bb all) {}