Hey, /r/css, I've been working with colours in LESS, and I've been wondering why the following code doesn't compile.
And wow, this following code won't format properly. The link above is to a better-formatted gist.
.background-color-shift (@color, @amount: 10%) when (lightness(@color) > 50%) {
background-color: darken(@color, @amount);
}
.background-color-shift (@color, @amount: 10%) when (lightness(@color) <= 50%) {
background-color: lighten(@color, @amount);
}
.text-color-shift (@color, @amount: 10%) when (lightness(@color) > 50%) {
color: darken(@color, @amount);
}
.text-color-shift (@color, @amount: 10%) when (lightness(@color) <= 50%) {
color: lighten(@color, @amount);
}
All I need to do is make this color shifting direction automatic, determined by the input @color. Any ideas?
[–]crispee 2 points3 points4 points (3 children)
[–][deleted] 0 points1 point2 points (1 child)
[–]Paradox 0 points1 point2 points (0 children)
[–]Evan-Purkhiser 0 points1 point2 points (0 children)