O'Reilly logo

Hands-On Full Stack Web Development with Aurelia by Erikson Haziz Murrugarra Sifuentes, Diego Jose Arguelles Rojas

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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!

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required