If/else statements

Oh, please, this is a really awesome feature! With this feature, you will be able to control the aspect of your page in a reactive way, based on determined conditions.

SASS example:

@if lightness($my-color) > 90% {
background-color: #FF0000;
}

@else {
background-color: #00FF00;
}

In LESS, the things are not similar. You need to use CSS guards:

.mixin (@my-color) when (lightness(@my-color) >80%) {
background-color: #00FF00;
}
.mixin (@my-color) when (lightness(@my-color) =< 80%) {
background-color: #FF0000;
}

These are not all the preprocessor features, but at this moment, they're enough to start working on our FIFA World Cup application!

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.218.188.95