Skip to content

Instantly share code, notes, and snippets.

@seven-phases-max
Last active February 13, 2018 13:51
Show Gist options
  • Save seven-phases-max/d7aae1f9e39c6e5f8c87dd499a56c881 to your computer and use it in GitHub Desktop.
Save seven-phases-max/d7aae1f9e39c6e5f8c87dd499a56c881 to your computer and use it in GitHub Desktop.
// usage:
@default-volume-color: white;
.test-1 {
.volume-color(novel, 1);
color: @volume-color;
}
.test-2 {
.volume-color(novel, 33);
color: @volume-color;
}
.test-3 {
.volume-color(vonel, -22);
color: @volume-color;
}
// ...........................
// impl.:
.volume-color(@media, @volume) {@volume-color: @default-volume-color}
.volume-color(novel, @volume) {@volume-color: green}
.volume-color(novel, 1) {@volume-color: red}
.volume-color(novel, 0) {@volume-color: @default-volume-color}
// usage:
@volume-color: white;
.test-1 {
.volume-color(novel, 1);
color: @volume-color;
}
.test-2 {
.volume-color(novel, 33);
color: @volume-color;
}
.test-3 {
.volume-color(something-else, -22);
color: @volume-color;
}
// ...........................
// impl.:
.volume-color(...) {}
.volume-color(novel, 1) {@volume-color: red}
.volume-color(novel, @volume)
when (@volume > 2) {@volume-color: green}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment