Skip to content

Instantly share code, notes, and snippets.

@d13
Last active February 16, 2017 14:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save d13/b31489dd37e0f34b5175 to your computer and use it in GitHub Desktop.
Save d13/b31489dd37e0f34b5175 to your computer and use it in GitHub Desktop.
LESS: Mixing variables into caller's scope
@import "vars";
@import "mixins";
.vanilla-sandwich {
.vanilla-config();
.icecream-sandwich();
}
.neopolitan-sandwich {
.neopolitan-config();
.icecream-sandwich();
}
.icecream-sandwich() {
background-color: @vars1;
color: @vars2;
border: 1x solid @vars3;
}
@vanilla: #fff;
@strawberry: #F78BB2;
@chocolate: #61543C;
.vanilla-config() {
@vars1: @vanilla;
@vars2: @vanilla;
@vars3: @chocolate;
}
.neopolitan-config() {
@vars1: @strawberry;
@vars2: @vanilla;
@vars3: @chocolate;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment