Sha256: ef4b8164578a91abf82d7f4de701bcc1f8ceb37aa5d766c4d1b07a343827b67e

Contents?: true

Size: 1.69 KB

Versions: 5

Compression:

Stored size: 1.69 KB

Contents

@x: red;
@x: blue;
@z: transparent;
@mix: none;

.mixin {
  @mix: #989;
}
@mix: blue;
.tiny-scope {
  color: @mix; // #989
  .mixin;
}

.scope1 {
  @y: orange;
  @z: black;
  color: @x; // blue
  border-color: @z; // black
  .hidden {
    @x: #131313;
  }
  .scope2 {
    @y: red;
    color: @x; // blue
    .scope3 {
      @local: white;
      color: @y; // red
      border-color: @z; // black
      background-color: @local; // white
    }
  }
}

#namespace {
  .scoped_mixin() {
    @local-will-be-made-global: green;
    .scope {
      scoped-val: @local-will-be-made-global;
    }
  }
}

#namespace > .scoped_mixin();

.setHeight(@h) { @height: 1024px; }
.useHeightInMixinCall(@h) { .useHeightInMixinCall { mixin-height: @h; } }
@mainHeight: 50%;
.setHeight(@mainHeight);
.heightIsSet { height: @height; }
.useHeightInMixinCall(@height);

.importRuleset() {
  .imported {
    exists: true;
  }
}
.importRuleset();
.testImported {
  .imported;
}

@parameterDefault: 'top level';
@anotherVariable: 'top level';
//mixin uses top-level variables
.mixinNoParam(@parameter: @parameterDefault) when (@parameter = 'top level') {
  default: @parameter;
  scope: @anotherVariable;
  sub-scope-only: @subScopeOnly;
}

#allAreUsedHere {
  //redefine top-level variables in different scope
  @parameterDefault: 'inside';
  @anotherVariable: 'inside';
  @subScopeOnly: 'inside';
  //use the mixin
  .mixinNoParam();
}
#parentSelectorScope {
  @col: white;
  & {
    @col: black;
  }
  prop: @col;
  & {
    @col: black;
  }
}
.test-empty-mixin() {
}
#parentSelectorScopeMixins {
  & {
    .test-empty-mixin() {
      should: never seee 1;
    }
  }
  .test-empty-mixin();
  & {
    .test-empty-mixin() {
      should: never seee 2;
    }
  }
}

Version data entries

5 entries across 5 versions & 2 rubygems

Version Path
ilog-0.4.1 node_modules/less/test/less/scope.less
ilog-0.4.0 node_modules/less/test/less/scope.less
ilog-0.3.3 node_modules/less/test/less/scope.less
less-execjs-2.6.0.4 lib/less/js/less/test/less/scope.less
less-execjs-2.6.0.3 lib/less/js/less/test/less/scope.less