Skip to content

Instantly share code, notes, and snippets.

@roden0
Created April 19, 2013 07:22
Show Gist options
  • Save roden0/5418670 to your computer and use it in GitHub Desktop.
Save roden0/5418670 to your computer and use it in GitHub Desktop.
Less Color Theming Mixin.
.colorDefs(@c1: #222, @c2: #fff) {
@colorOne: @c1;
@colorTwo: @c2;
@darkGradientStart: lighten(@colorOne, 10%);
@darkGradientStop: lighten(@colorOne, 5%);
@lightGradientStart: @colorTwo;
@lightGradientStop: darken(@colorTwo, 7%);
}
.theme-blue {
//import color definitions
.colorDefs(blue, yellow);
// use them
color: @colorOne;
background-color: @colorTwo;
.gradient1 {
background-image: linear-gradient(top, @darkGradientStart, @darkGradientStop);
}
.gradient1 {
background-image: linear-gradient(top, @lightGradientStart, @lightGradientStop);
}
}
.theme-green {
//import different color definitions
.colorDefs(green, red);
// use them
color: @colorOne;
background-color: @colorTwo;
.gradient1 {
background-image: linear-gradient(top, @darkGradientStart, @darkGradientStop);
}
.gradient1 {
background-image: linear-gradient(top, @lightGradientStart, @lightGradientStop);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment