leafo/lessphp — Issue #147: Allow Conditions like possible in SASS or SCSS ;)
Author: kaystrobach
Created: 2011-11-10 10:13:54+00:00
State: open

Hi Guys,

i really like the simple approach behind less and would like to have conditions like they are possible in scss or sas:

f.e. you ask the user in a cms to setup a color:

And then you need to calculate the textcolor from this color, you will need something like a condition to ensure, that the contrast is still big enough to read the text.

#footer-container {
@if lightness($main-color) < 10% {
color: lighten($main-color,15%);
} @else {
color: darken($main-color,20%);
}

}

Thanks in advance
Kay