Skip to content

Instantly share code, notes, and snippets.

@d13 d13/icecream-sandwich.less
Last active Feb 16, 2017

Embed
What would you like to do?
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
You can’t perform that action at this time.